Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using HLookup to copy budget model data into a "User" column based on
the size of the business. The HLookup is working great, but when I copy the first cell down for all the rows of data, the "row variable" (1,TRUE) in the HLookup formula does not change. It stays at the first row. Here is the formula: =HLOOKUP($A$13,$C$1:$F$10,1,TRUE) I want to create a macro that let's me select all the cells containing the formula, starting with the first (good) formula, goes to the next cell in the selected range, reads the formula, adds 1 to the row variable...(so that the 2nd row would be 2,TRUE), writes the formula, goes to the next cell, adds 1 again (assuming the macro would have a variable that would be kept until the next time 1 is added) so that the 3rd cell would be 3,TRUE and continue until the end of the selected range. All the formulas would be in the same column. Just need each cell to advance by 1. Here's what I've started with: Sub DoOnSelection() Dim oCell As Range For Each oCell In Selection NEED CODE HERE TO CHANGE THE NUMBER IN FORMULA Next End Sub Thanks in advance for the help!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Want to use same Chart against changing data and variable titles? | Charts and Charting in Excel | |||
Range("C9:V9").Select ==> changing the 9 to a variable | Excel Worksheet Functions | |||
Changing a formula using a variable... | Excel Programming | |||
changing selected label on userform w/ a variable | Excel Programming | |||
Changing a range number to a variable | Excel Programming |