Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with formula
This code was submitted by SeanC. What this code does is copy the contents
of row A and inserts a row above cells that contains data AND copies complete row to inserted row and deletes data from original row. This code counts from last row to first and thats ok. However this is what I need. Example of what I need: Column A B C D time for A Break original row New inserted row: Column A B C D time inserted row for A Break original row Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount + 1).EntireRow.Insert shift:=xlDown End If Next End Sub How can I modify this code Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with formula
Try
Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount).EntireRow.Insert Shift:=xlDown Cells(lngRowCount + 1, 1).Cut Cells(lngRowCount, 1).Select ActiveSheet.Paste End If Next End Sub Hope this helps, Hutch "Stanley Braverman" wrote: This code was submitted by SeanC. What this code does is copy the contents of row A and inserts a row above cells that contains data AND copies complete row to inserted row and deletes data from original row. This code counts from last row to first and thats ok. However this is what I need. Example of what I need: Column A B C D time for A Break original row New inserted row: Column A B C D time inserted row for A Break original row Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount + 1).EntireRow.Insert shift:=xlDown End If Next End Sub How can I modify this code Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with formula
Try
Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount).EntireRow.Insert Shift:=xlDown Cells(lngRowCount + 1, 1).Cut Cells(lngRowCount, 1).Select ActiveSheet.Paste End If Next End Sub Hope this helps, Hutch "Stanley Braverman" wrote: This code was submitted by SeanC. What this code does is copy the contents of row A and inserts a row above cells that contains data AND copies complete row to inserted row and deletes data from original row. This code counts from last row to first and thats ok. However this is what I need. Example of what I need: Column A B C D time for A Break original row New inserted row: Column A B C D time inserted row for A Break original row Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount + 1).EntireRow.Insert shift:=xlDown End If Next End Sub How can I modify this code Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with formula
Thank You Tom,
That worked very well =:) Stanley "Tom Hutchins" wrote in message ... Try Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount).EntireRow.Insert Shift:=xlDown Cells(lngRowCount + 1, 1).Cut Cells(lngRowCount, 1).Select ActiveSheet.Paste End If Next End Sub Hope this helps, Hutch "Stanley Braverman" wrote: This code was submitted by SeanC. What this code does is copy the contents of row A and inserts a row above cells that contains data AND copies complete row to inserted row and deletes data from original row. This code counts from last row to first and thats ok. However this is what I need. Example of what I need: Column A B C D time for A Break original row New inserted row: Column A B C D time inserted row for A Break original row Public Sub Temp() Dim lngRowCount As Long For lngRowCount = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 If Not IsEmpty(Cells(lngRowCount, 1)) Then Rows(lngRowCount + 1).EntireRow.Insert shift:=xlDown End If Next End Sub How can I modify this code Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula | Excel Worksheet Functions | |||
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible | Excel Discussion (Misc queries) | |||
Build excel formula using field values as text in the formula | Excel Worksheet Functions | |||
Formula expected end of statement error, typing formula into cell as part of VBA macro | Excel Programming | |||
Commenting custom formula fields/formula on formula editor | Excel Programming |