Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I can't seem to get this, but
if I wanted to run a macro that would start at cell G50 and move upward to Cell G18 testing for the value P and if it is found insert a single row beneath it (passing on all other rows that do not have P), how would I do this? TIA, |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try:
Sub InsertRow() For irow = 50 To 8 Step -1 If Cells(irow, "G") = "P" Then Cells(irow + 1, "G").Insert Shift:=xlDown End If Next irow End Sub "Jim May" wrote: I can't seem to get this, but if I wanted to run a macro that would start at cell G50 and move upward to Cell G18 testing for the value P and if it is found insert a single row beneath it (passing on all other rows that do not have P), how would I do this? TIA, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chg 1 "Last, First Mid" column to 3 "First", "Middle", "Last" colu | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |