Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I have created a simple macro that, among other things, places a formula in I2 that subtracts H2 from G2. The macro, then, copies this formula down the entire column of I and formats column I to be "values" instead of "formulas". That's all well and good. But I only want the macro to conduct this sort of copying and formatting of column I only where there is data in column H. I mean, if the data in the spreadsheet does not go past row 131, then I do not want any data in column I that is beyond I131. Could someone please review my macro below and let me know how I can modify the VBA code to accomplish this? Thanks! childofthe1980s Range("I2").Select ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]" Range("I2").Select Selection.Copy Columns("I:I").Select ActiveSheet.Paste Range("I1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "Need" Columns("I:I").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("A1").Select Application.CutCopyMode = False |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COPY DATA FROM 2 CELLS | Excel Programming | |||
How to copy data from merged cells to their individual cells? | Excel Programming | |||
how to copy cells data in every 7th row? | Excel Programming | |||
Copy data into cells until changes trigger new copy | Excel Programming | |||
How do I copy data (word) into respective cells when the data bei. | New Users to Excel |