Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
"Mike Tomasura" wrote in message ... Try this. Private Sub CommandButton1_Click() x = 1 Do While Range("A" & x) < "" 'if a = true (cell contains a certain value) If Range("A" & x) = "yes" Then ' make room for paste Rows(x + 1 & ":" & x + 1).Select Selection.Insert Shift:=xlDown Range("A" & x).Select ' Paste Range("A" & x + 1) = Range("A" & x) ' Skip 3 Rows(x + 1 & ":" & x + 1).Select: Selection.Insert Shift:=xlDown Rows(x + 1 & ":" & x + 1).Select: Selection.Insert Shift:=xlDown Rows(x + 1 & ":" & x + 1).Select: Selection.Insert Shift:=xlDown ' paste again Range("A" & x + 1) = Range("A" & x) x = x + 4 End If x = x + 1 Loop End Sub Michael Tomasura "DTHMTL" wrote in message ... Could someone possible give me a quick sample code or point me in the right direction. I imported a text file. I want to : begin loop if a = true (cell contains a certain value) copy paste skip 3 copy & paste again else (cell doesn't contain a value) move onto next row end if end loop Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |