Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying work on sheet that has data pasted to it that always has the same
columns but rows vary each time. I need to enter a value into "B" column and a formula into "H" & "I" for each row that has data. I have a couple of macros that do most this, but can't consistently make it work. Any suggestions? Thanks, Brad K. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Depends somewhat on what you are doing, eg FormulaR1C1 might work better.
following just for ideas - Sub test() Dim nLastRow As Long ' sample data in col-A For i = 2 To 11 n = n + 10 Cells(i, 1).Value = n Next nLastRow = Range("A65536").End(xlUp).Row Range("B2:B" & nLastRow).Value = 5 Range("H2:H" & nLastRow).Formula = "=A2+B2" Range("I2:I" & nLastRow).Formula = "=H2 * 10" End Sub Regards, Peter T "Brad K." wrote in message ... I am trying work on sheet that has data pasted to it that always has the same columns but rows vary each time. I need to enter a value into "B" column and a formula into "H" & "I" for each row that has data. I have a couple of macros that do most this, but can't consistently make it work. Any suggestions? Thanks, Brad K. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use variable in macro coding | Excel Discussion (Misc queries) | |||
Including a third variable in a point diagram by color-coding | Excel Discussion (Misc queries) | |||
Variable coding | Excel Programming | |||
excel help, color coding rows | Excel Programming | |||
KEEP blank rows when coding ranges | Excel Programming |