Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi again:
Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi
you have received some answers to this (laso dealing with only inserting the cells). Have you tried them? -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi again: Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi Frank:
Sorry, but I did not see any... Thanks, Dan -----Original Message----- Hi you have received some answers to this (laso dealing with only inserting the cells). Have you tried them? -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi again: Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi
------------------- Hi try: Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If Cells(row_index+1, "C").Value ="No" Then Cells(row_index + 1, "A").resize(1,3).Insert (xlShiftDown) End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi Frank: Sorry, but I did not see any... Thanks, Dan -----Original Message----- Hi you have received some answers to this (laso dealing with only inserting the cells). Have you tried them? -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi again: Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi Frank:
Does not do anything.... The last one was working, but inserted the whole row, this one: Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If Cells(row_index+1, "C").Value ="No" Then Cells(row_index + 1, "C").EntireRow.Insert (xlShiftDown) End If Next End Sub -----Original Message----- Hi ------------------- Hi try: Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If Cells(row_index+1, "C").Value ="No" Then Cells(row_index + 1, "A").resize(1,3).Insert (xlShiftDown) End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi Frank: Sorry, but I did not see any... Thanks, Dan -----Original Message----- Hi you have received some answers to this (laso dealing with only inserting the cells). Have you tried them? -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi again: Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan . . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code - Repost
Hi
just tested it again and it works without a problem. It inserts only cell in columns A-C if column C contains 'No'. And it inserts it above the 'no' -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi Frank: Does not do anything.... The last one was working, but inserted the whole row, this one: Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If Cells(row_index+1, "C").Value ="No" Then Cells(row_index + 1, "C").EntireRow.Insert (xlShiftDown) End If Next End Sub -----Original Message----- Hi ------------------- Hi try: Sub insert_rows() Dim lastrow As Long Dim row_index As Long lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row For row_index = lastrow - 1 To 1 Step -1 If Cells(row_index+1, "C").Value ="No" Then Cells(row_index + 1, "A").resize(1,3).Insert (xlShiftDown) End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi Frank: Sorry, but I did not see any... Thanks, Dan -----Original Message----- Hi you have received some answers to this (laso dealing with only inserting the cells). Have you tried them? -- Regards Frank Kabel Frankfurt, Germany Dan wrote: Hi again: Please let me know, because I did not get an answer, what would be the code for: A B C D 1 1 OK a 2 2 OK b 3 4 NO c d If No is found higlight the cels a, b,c, and insert a row above - Not insert the entire row-! Thank you and I appreciate, Dan . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Had to repost it!!! | Excel Discussion (Misc queries) | |||
Repost of VBA Code/Lookup question | Excel Worksheet Functions | |||
Repost with code - Runtime error '1004' | Excel Programming | |||
REPOST for Tom (or anyone else that can help) | Excel Programming | |||
Code for Buttons (repost) | Excel Programming |