excel autofill macro

A

angieg

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!
 
A

Anders S

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
 
A

Anders S

One small addition,

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

Anders Silven

Anders S said:
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
 
Top