Logo 
Search:

VB.Net Answers

Ask Question   UnAnswered
Home » Forum » VB.Net       RSS Feeds
  Question Asked By: Lee Koefoed   on Jul 12 In VB.Net Category.

  
Question Answered By: Lee Koefoed   on Jul 12

FYI the codes I have used - without any result - are:

Sub CMRDatenDSc_Button2_Click()

If Not Intersect(Target, Range("A:X")) Is Nothing Then 'This makes the code execute only when a value in column C is changed

Application.EnableEvents = False 'This prevents infinate loop

lastrow = Range("A1048576:X1048576").End(xlUp).Row
Range("Y6:AE6").AutoFill Destination:=Range("Y6:AE" & lastrow), Type:=xlFillDefault
Application.EnableEvents = True
End If
End Sub

Or

Sub CMRDatenDSc_Button2_Click()

Private Sub Worksheet_Change(ByVal Target As Range)
lastrow = Range("A1048576:X1048576").End(xlUp).Row
Application.EnableEvents = False 'This prevents infinate loop
Range("Y6:AE6").AutoFill Destination:=Range("Y6:AE" & lastrow), Type:=xlFillDefault
Application.EnableEvents = True
End Sub

Or

Sub CMRDatenDSc_Button2_Click()

a = Cells(A:X).End(xlUp).Row
b = "Y6:AE6" & a
Selection.AutoFill Destination:=Range(b)

End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 


Tagged: