Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel autofill macro

Can someone please help me figure out a macro that I can use to autofil
a formula into all the cells below it until the data on the lef
quits?
This is the situation:
I have several worksheets that I have to insert the followin
formula(="t"&right(b2,12)) to cell d2. The problem I need help with i
that sometimes I have to copy this down to row 42 and sometimes I hav
to copy this to row 5300. It varies with each workbook. Can someon
please help me? This small macro would save me hours of time eac
week.
Thanks in advance for your help!

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default excel autofill macro

Probably no need for a macro, try this,

Enter the formula in D2, then select D2 and double-click the fill handle (the
little black square in the bottom right corner of the cell).

HTH
Anders Silven

"angieg " skrev i meddelandet
...
Can someone please help me figure out a macro that I can use to autofill
a formula into all the cells below it until the data on the left
quits?
This is the situation:
I have several worksheets that I have to insert the following
formula(="t"&right(b2,12)) to cell d2. The problem I need help with is
that sometimes I have to copy this down to row 42 and sometimes I have
to copy this to row 5300. It varies with each workbook. Can someone
please help me? This small macro would save me hours of time each
week.
Thanks in advance for your help!!


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default excel autofill macro

One small addition,

This will not work if column C is empty. If so, enter the formula in column C.

Anders Silven

"Anders S" skrev i meddelandet
...
Probably no need for a macro, try this,

Enter the formula in D2, then select D2 and double-click the fill handle (the
little black square in the bottom right corner of the cell).

HTH
Anders Silven

"angieg " skrev i meddelandet
...
Can someone please help me figure out a macro that I can use to autofill
a formula into all the cells below it until the data on the left
quits?
This is the situation:
I have several worksheets that I have to insert the following
formula(="t"&right(b2,12)) to cell d2. The problem I need help with is
that sometimes I have to copy this down to row 42 and sometimes I have
to copy this to row 5300. It varies with each workbook. Can someone
please help me? This small macro would save me hours of time each
week.
Thanks in advance for your help!!


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default excel autofill macro

Sub Auto_Fill()
Dim lrow As Long
With ActiveSheet
lrow = Range("B" & Rows.Count).End(xlUp).Row
Range("D2:D" & lrow).FillDown
End With
End Sub

Gord Dibben Excel MVP

On Mon, 17 May 2004 15:42:28 -0500, angieg
wrote:

Can someone please help me figure out a macro that I can use to autofill
a formula into all the cells below it until the data on the left
quits?
This is the situation:
I have several worksheets that I have to insert the following
formula(="t"&right(b2,12)) to cell d2. The problem I need help with is
that sometimes I have to copy this down to row 42 and sometimes I have
to copy this to row 5300. It varies with each workbook. Can someone
please help me? This small macro would save me hours of time each
week.
Thanks in advance for your help!!


---
Message posted from http://www.ExcelForum.com/


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel autofill macro

Thanks to all for your fast response. I figured it out!! See cod
below. The reason I wanted a macro is because there are severa
columns that I needed to do this to 20 to 30 times a day, and typin
the same formula over and over gets soooo old. I'll definitely b
coming back here for more answers.

Angie

Sub autofill()
Dim LastRow As Long
With Worksheets("Sheet2")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("D2").autofill Destination:=.Range("D2:D" & LastRow) _
, Type:=xlFillDefault
End With
End Su

--
Message posted from http://www.ExcelForum.com

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
HELP!!! I need macro to autofill Joe M. Excel Discussion (Misc queries) 4 February 10th 10 07:32 PM
Autofill in macro orquidea Excel Discussion (Misc queries) 5 November 21st 07 11:20 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
macro to autofill formula? Todd[_5_] Excel Programming 2 October 6th 03 07:10 PM


All times are GMT +1. The time now is 07:31 AM.

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

About Us

"It's about Microsoft Excel"