Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
is it possible to autofill data in more then one field in one command
code when the cells are not close to each other? for example range("A1,D1,G1).select i would like to autofill of them at one command is it posible? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thread,
I am a vba newbie, this small excerpt should get you started and works fine for me. Dim Lastrow As Long Lastrow = Worksheets("urspreadsheet").Cells(Rows.Count, "A").End(xlUp).Row Set SourceRange = Worksheets("urspreadsheet").Range("b2") Set fillRange = Worksheets("urspreadsheet").Range("b2:b" & Lastrow) SourceRange.AutoFill Destination:=fillRange Add the three lines above as necessary for other columns. "thread" wrote: is it possible to autofill data in more then one field in one command code when the cells are not close to each other? for example range("A1,D1,G1).select i would like to autofill of them at one command is it posible? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, I believe you would have to do it separately.
this plays at doing it together, but actually does it separately Sub Autofill() Dim SourceRange as Range, FillRange as Range Dim ar as Range, i as Long Set SourceRange = Worksheets("Sheet2") _ .Range("A1,D1,G1") Set fillRange = Worksheets("Sheet2") _ .Range("A1:A20,D1:D20,G1:G20") i = 1 For Each ar In SourceRange.Areas ar.Autofill Destination:=fillRange.Areas(i) i = i + 1 Next End Sub -- Regards, Tom Ogilvy "thread" wrote: is it possible to autofill data in more then one field in one command code when the cells are not close to each other? for example range("A1,D1,G1).select i would like to autofill of them at one command is it posible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I can't autofill cells in a column if blank cells in between | Excel Worksheet Functions | |||
Autofill cell/sets of cells based upon value selected from a list. | Excel Discussion (Misc queries) | |||
can autofill be used on merged cells? | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
How can i autofill cells | Excel Programming |