Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
YES... It works Great....
Thanks Stan "Rick Rothstein" wrote in message ... Sure, just replace this line... With Worksheets("Sheet2") with this one... With ActiveSheet -- Rick (MVP - Excel) "Stanley Braverman" wrote in message ... I just changed it and still getting same subscript out of range error. Could you change code to active worksheet? Thanks, Stan "Rick Rothstein" wrote in message ... Did you change the worksheet name reference in the With statement? I used "Sheet2" as an example because you didn't tell us what the actual worksheet name is. -- Rick (MVP - Excel) "Stanley Braverman" wrote in message ... Thanks Rick for this code. I am getting subscript out of range error. Thanks Stan "Rick Rothstein" wrote in message ... I think this does what you say you want to do... Sub ProcessColumnA() Dim X As Long Dim LastRow As Long Const FirstRowWithData As Long = 2 With Worksheets("Sheet2") LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For X = LastRow To FirstRowWithData Step -1 If .Cells(X, "A").Value < "" Then .Rows(X).Insert .Cells(X, "A").Offset(1).Copy .Cells(X, "A") .Cells(X, "A").Offset(1).Clear End If Next End With End Sub -- Rick (MVP - Excel) "Stanley Braverman" wrote in message ... I need a macro that will: If cell in column A is not blank. (Column A,B,C and D will contain data) Then copy contents of that cell and then insert entire row then copy to the new row and delete original cell. I will need a loop till done. Thanks for any help on this macro. Example: Row 5 cell A5 contains data Insert row (New Row is now row 5)(Old row now row 6) Copy from old cell and copy to new row 5 (A 5) then(delete cell A6) Then delete contents cell A6. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Programming | |||
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON | Excel Programming | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |