Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to write a basic macro that will copy a formula
down in column b to the same row that the data ends in column a. There's nothing too complex about this, and I'm sure I'm just overlooking a simple solution, but I can't figure it out. My code up to this point (which I posted below) copies the formula down to an arbitrary row. Please help. Thanks. 'CHANGING ZIP CODE CELLS TO CORRECT FORMAT Range("C3").Select ActiveCell.FormulaR1C1 = "=RC[-2]+0" Range("C3").Select Selection.AutoFill Destination:=Range("C3:C104"), Type:=xlFillDefault Range("C3:C104").Select Selection.Copy ActiveWindow.LargeScroll Down:=-4 Range("A3").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Columns("A:A").Select Selection.NumberFormat = "00000" Columns("C:C").Select Application.CutCopyMode = False Selection.ClearContents 'VLOOKUPS Range("B3").Select ActiveCell.FormulaR1C1 = _ "=IF(ISERROR(VLOOKUP(RC[-1], ZIPS, 2, FALSE)), ""INDEP."", VLOOKUP(RC[-1], ZIPS, 2, FALSE))" Range("B3").Select Selection.AutoFill Destination:=Range("B3:B104") Range("B3:B104").Select Range("B3").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Formulas | Excel Worksheet Functions | |||
copying formulas | Excel Worksheet Functions | |||
copying formulas | Excel Discussion (Misc queries) | |||
Copying Formulas | Excel Worksheet Functions | |||
Copying Formulas | Excel Discussion (Misc queries) |