Problem w VB to Expand an Excel Formula

Casey

Board Regular
Joined
Feb 18, 2002
Messages
82
Hi,
I was wondering if anyone can tell me what ive done wrong in this VB code im using.(ill post below) Im trying to use it to place formulas in a column that wont expand down the column if I try manually. Please let me know what you all think
Thanks Casey

Sub FormulaExpansion()
'
' FormulaExpansion Macro
' Macro recorded 10/8/2002 by cfrank
'
Dim counter
Dim i As Integer
' Input box to determine the total number of rows in the worksheet.
counter = 384
ActiveCell.Select
' Loops through the desired number of rows.
For i = 1 To counter
' Checks to see if the active cell is blank.
Selection.Formula = "=IF(C4<A" & i + 11 & ",B" & i + 11 & "-(((A" & i + 11 + "-C3)/D4)+B3),0)"

ActiveCell.Offset(1, 0).Select
Next i


'

End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
This is the section of the formula
I dont know why it didnt paste


Selection.Formula = "=IF(C4<A" & i + 11 & ",B" & i + 11 & "-(((A" & i + 11 + "-C3)/D4)+B3),0)"
 
Upvote 0
Selection.Formula = "=IF(C4<A" & i + 11 & ",B" & i + 11 & "-(((A" & i + 11 + "-C3)/D4)+B3),0)"
 
Upvote 0

Forum statistics

Threads
1,202,990
Messages
6,052,948
Members
444,620
Latest member
marialewis16

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top