Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
tonto57
 
Posts: n/a
Default autofill a column alongside a range - how ?

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   Report Post  
Posted to microsoft.public.excel.misc
Stefi
 
Posts: n/a
Default autofill a column alongside a range - how ?

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   Report Post  
Posted to microsoft.public.excel.misc
tonto57
 
Posts: n/a
Default autofill a column alongside a range - how ?

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   Report Post  
Posted to microsoft.public.excel.misc
tonto57
 
Posts: n/a
Default autofill a column alongside a range - how ?

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   Report Post  
Posted to microsoft.public.excel.misc
tonto57
 
Posts: n/a
Default autofill a column alongside a range - how ?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to drag and autofill a non consecutive range of cells? PH Excel Discussion (Misc queries) 1 March 9th 06 07:48 PM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Program Column B to record numerical range based on number in colm Nikole Excel Discussion (Misc queries) 2 August 17th 05 08:37 PM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
print 3 column range in six columns dawgpilot Excel Discussion (Misc queries) 3 April 28th 05 10:53 PM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"