Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default HELP!!! I need macro to autofill

Hello...I need a macro to autofill a formula as long as there is data in Col
A. My problem is that I have totals data in Row 51 so I need the autofill go
no farther down than row 50. The first cell to have data is A4. The last row
in Col A to have data varies but always ends somewhere before A51. The
formulas to be autofilled are in B4:I4. The current macro below fills all the
way down to A51 because totals data resides in A51 which is incorrect for my
needs. The macro I have now is below. How can it be changed so it doesn't
look all the way to the end of the WS for data in Col A and instead fills no
farther than row 50? Thanks! Joe M.

Sub Extend_Form1()
'
Sheets("Hours").Select
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
..Range("B4:I" & lRow).FillDown
End With
'
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default HELP!!! I need macro to autofill

Hi

This should do it:

lRow = .Range("A51").End(xlUp).Row

Regards,
Per

On 10 Feb., 18:23, Joe M. wrote:
Hello...I need a macro to autofill a formula as long as there is data in Col
A. My problem is that I have totals data in Row 51 so I need the autofill go
no farther down than row 50. The first cell to have data is A4. The last row
in Col A to have data varies but always ends somewhere before A51. The
formulas to be autofilled are in B4:I4. The current macro below fills all the
way down to A51 because totals data resides in A51 which is incorrect for my
needs. The macro I have now is below. How can it be changed so it doesn't
look all the way to the end of the WS for data in Col A and instead fills no
farther than row 50? Thanks! Joe M.

Sub Extend_Form1()
'
Sheets("Hours").Select
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B4:I" & lRow).FillDown
End With
'
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default HELP!!! I need macro to autofill

Use this line instead:

lRow = .Range("A51").End(xlUp).Row

This will return the last row in column A with data that is above row 51.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Joe M." wrote:

Hello...I need a macro to autofill a formula as long as there is data in Col
A. My problem is that I have totals data in Row 51 so I need the autofill go
no farther down than row 50. The first cell to have data is A4. The last row
in Col A to have data varies but always ends somewhere before A51. The
formulas to be autofilled are in B4:I4. The current macro below fills all the
way down to A51 because totals data resides in A51 which is incorrect for my
needs. The macro I have now is below. How can it be changed so it doesn't
look all the way to the end of the WS for data in Col A and instead fills no
farther than row 50? Thanks! Joe M.

Sub Extend_Form1()
'
Sheets("Hours").Select
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B4:I" & lRow).FillDown
End With
'
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default HELP!!! I need macro to autofill

Thanks very much!

"Per Jessen" wrote:

Hi

This should do it:

lRow = .Range("A51").End(xlUp).Row

Regards,
Per

On 10 Feb., 18:23, Joe M. wrote:
Hello...I need a macro to autofill a formula as long as there is data in Col
A. My problem is that I have totals data in Row 51 so I need the autofill go
no farther down than row 50. The first cell to have data is A4. The last row
in Col A to have data varies but always ends somewhere before A51. The
formulas to be autofilled are in B4:I4. The current macro below fills all the
way down to A51 because totals data resides in A51 which is incorrect for my
needs. The macro I have now is below. How can it be changed so it doesn't
look all the way to the end of the WS for data in Col A and instead fills no
farther than row 50? Thanks! Joe M.

Sub Extend_Form1()
'
Sheets("Hours").Select
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B4:I" & lRow).FillDown
End With
'
End Sub


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default HELP!!! I need macro to autofill

Thank you!

"Luke M" wrote:

Use this line instead:

lRow = .Range("A51").End(xlUp).Row

This will return the last row in column A with data that is above row 51.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Joe M." wrote:

Hello...I need a macro to autofill a formula as long as there is data in Col
A. My problem is that I have totals data in Row 51 so I need the autofill go
no farther down than row 50. The first cell to have data is A4. The last row
in Col A to have data varies but always ends somewhere before A51. The
formulas to be autofilled are in B4:I4. The current macro below fills all the
way down to A51 because totals data resides in A51 which is incorrect for my
needs. The macro I have now is below. How can it be changed so it doesn't
look all the way to the end of the WS for data in Col A and instead fills no
farther than row 50? Thanks! Joe M.

Sub Extend_Form1()
'
Sheets("Hours").Select
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B4:I" & lRow).FillDown
End With
'
End Sub


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
AutoFill Macro Issue Jon Excel Discussion (Misc queries) 1 March 13th 08 02:18 PM
Autofill in macro orquidea Excel Discussion (Misc queries) 5 November 21st 07 11:20 PM
Macro to autofill column [email protected] Excel Discussion (Misc queries) 1 June 21st 06 04:21 PM
Autofill macro Mike G Excel Discussion (Misc queries) 6 April 21st 05 01:33 AM
autofill macro glee Excel Discussion (Misc queries) 1 February 14th 05 05:14 PM


All times are GMT +1. The time now is 10:57 AM.

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"