Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I'm trying to do an autofill on a dynamic range of cells, and I'm having some trouble. Here is what I have so far:
Code:
Range("CR2:DC2").Select i = Selection.End(xlDown).Row Intersect(Range("CR:DC"), Rows(i)).Select LastRow = ActiveSheet.Range("A1").End(xlDown).Row Selection.Autofill Destination:=Range( ? & LastRow) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Keri,
This worked for me: LastRow = ActiveSheet.Range("A1").End(xlDown).Row Range("CR2:DC2").AutoFill Destination:=Range("CR2:DC" & LastRow) -Ben |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I maybe on the wrong track here but try this. Sub Copy_myRng() Dim SS As Worksheet 'Source Dim TS As Worksheet 'Target Dim mySrng As Range Dim myTrng As Range With Application .ScreenUpdating = False .EnableEvents = False End With Set SS = Sheets("Sheet1") Set mySrng = SS.Range("CR2:DC2") Set TS = Sheets("Sheet2") Set myTrng = TS.Range("A1") With mySrng .Copy Destination:=myTrng End With With Application .ScreenUpdating = True .EnableEvents = True End With End Sub HTH Mick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofill Dynamic Range | Excel Programming | |||
Dynamic range for autofill macro | Excel Discussion (Misc queries) | |||
making autofill range dynamic | Excel Programming | |||
autofill with dynamic range | Excel Programming | |||
autofill with dynamic range again | Excel Programming |