LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AutoFill Formula with code


Hi all,

This whole thing needs to change based on the last used cell in column
C.

There is a formula in:
G2 '=IF(D2="","",(D2*F2))
I2 '=IF(D2="","",(H2/G2))
J2 '=IF(E2="","",(H2/E2))

Want to Auto Fill the formulas down, but only down as far as the last
used cell in column C.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Then
With Cells(Rows.Count, 3).End(xlUp).Select
Range("g2").AutoFill Destination:=Range("g3 to ???????")
Range("I2").AutoFill Destination:=Range("I3 to ???????")
Range("J2").AutoFill Destination:=Range("J3 to ???????")
End With
End If
End Sub

Any Direction would be great.


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=509141

 
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 data based on an assigned code/prefix anrcreations Excel Worksheet Functions 2 February 11th 10 07:50 PM
Autofill formula to next row ASU Excel Discussion (Misc queries) 4 September 12th 06 11:29 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
VBA code to Autofill one cell to many rows below where row count will change TrainingGoddess Excel Programming 5 March 28th 05 03:53 AM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM


All times are GMT +1. The time now is 04:38 PM.

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"