Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a range established in columns G, H , I and J - a variable number of
rows. I want to autofill columns A - F with a formula, but only for as many rows as exist at that time in the Range described above. Currnetly I have the formulas in the header row for columns A - F, so I can manually drag them down the corect number of rows each time. but can I automatate this in a VBA macro ? Suggestions Welcome. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub autodrag()
lastrow = ActiveSheet.Columns("G:J").Find(What:="*", _ After:=Range("G1"), _ LookAt:=xlPart, _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row Range("A1:F1").AutoFill Destination:=Range("A1:F" & lastrow), Type:=xlFillDefault End Sub Regards, Stefi €˛tonto57€¯ ezt Ć*rta: I have a range established in columns G, H , I and J - a variable number of rows. I want to autofill columns A - F with a formula, but only for as many rows as exist at that time in the Range described above. Currnetly I have the formulas in the header row for columns A - F, so I can manually drag them down the corect number of rows each time. but can I automatate this in a VBA macro ? Suggestions Welcome. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thans Stefi, before I try that though - is there not a brackets mismatch on
the lastrow assignment line ? "Stefi" wrote: Sub autodrag() lastrow = ActiveSheet.Columns("G:J").Find(What:="*", _ After:=Range("G1"), _ LookAt:=xlPart, _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row Range("A1:F1").AutoFill Destination:=Range("A1:F" & lastrow), Type:=xlFillDefault End Sub Regards, Stefi €˛tonto57€¯ ezt Ć*rta: I have a range established in columns G, H , I and J - a variable number of rows. I want to autofill columns A - F with a formula, but only for as many rows as exist at that time in the Range described above. Currnetly I have the formulas in the header row for columns A - F, so I can manually drag them down the corect number of rows each time. but can I automatate this in a VBA macro ? Suggestions Welcome. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
apologies - I see the bracket now
"Stefi" wrote: Sub autodrag() lastrow = ActiveSheet.Columns("G:J").Find(What:="*", _ After:=Range("G1"), _ LookAt:=xlPart, _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row Range("A1:F1").AutoFill Destination:=Range("A1:F" & lastrow), Type:=xlFillDefault End Sub Regards, Stefi €˛tonto57€¯ ezt Ć*rta: I have a range established in columns G, H , I and J - a variable number of rows. I want to autofill columns A - F with a formula, but only for as many rows as exist at that time in the Range described above. Currnetly I have the formulas in the header row for columns A - F, so I can manually drag them down the corect number of rows each time. but can I automatate this in a VBA macro ? Suggestions Welcome. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Spot On ! thank you Stefi.
"Stefi" wrote: Sub autodrag() lastrow = ActiveSheet.Columns("G:J").Find(What:="*", _ After:=Range("G1"), _ LookAt:=xlPart, _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row Range("A1:F1").AutoFill Destination:=Range("A1:F" & lastrow), Type:=xlFillDefault End Sub Regards, Stefi €˛tonto57€¯ ezt Ć*rta: I have a range established in columns G, H , I and J - a variable number of rows. I want to autofill columns A - F with a formula, but only for as many rows as exist at that time in the Range described above. Currnetly I have the formulas in the header row for columns A - F, so I can manually drag them down the corect number of rows each time. but can I automatate this in a VBA macro ? Suggestions Welcome. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to drag and autofill a non consecutive range of cells? | Excel Discussion (Misc queries) | |||
Return SEARCHED Column Number of Numeric Label and Value | Excel Worksheet Functions | |||
Program Column B to record numerical range based on number in colm | Excel Discussion (Misc queries) | |||
Match function...random search? | Excel Worksheet Functions | |||
print 3 column range in six columns | Excel Discussion (Misc queries) |