Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have a macro that insert a line every time the value in C changes. Now I
want to add that it must put in the new row in A the text that is in C in the row just under this row. So This would be like a heading. Hope I am not too fuzzy. |
#2
![]() |
|||
|
|||
![]()
Esrei,
Post your old code. HTH, Bernie MS Excel MVP "Esrei" wrote in message ... I have a macro that insert a line every time the value in C changes. Now I want to add that it must put in the new row in A the text that is in C in the row just under this row. So This would be like a heading. Hope I am not too fuzzy. |
#3
![]() |
|||
|
|||
![]()
Bit of a long one working on a priclist to be coppied and made presentable
from a DB. Sheets("Prys berekening").Select Range("A1:N1").Copy Sheets("Cust price list").Select Range("A16").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Sheets("Prys berekening").Select Range("A2:N311").Select Application.CutCopyMode = False Selection.Copy Sheets("Cust price list").Select Range("A17").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Range("B:B,D:E,G:G,N:N").Delete Shift:=xlToLeft Dim row_index As Long Application.ScreenUpdating = False lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row For row_index = lastrow - 1 To 2 Step -1 If Cells(row_index, "D").Value < _ Cells(row_index + 1, "D").Value Then Cells(row_index + 1, "D").EntireRow.Insert _ (xlShiftDown) End If Next End Sub "Bernie Deitrick" wrote: Esrei, Post your old code. HTH, Bernie MS Excel MVP "Esrei" wrote in message ... I have a macro that insert a line every time the value in C changes. Now I want to add that it must put in the new row in A the text that is in C in the row just under this row. So This would be like a heading. Hope I am not too fuzzy. |
#4
![]() |
|||
|
|||
![]()
Esrei,
Change For row_index = lastrow - 1 To 2 Step -1 If Cells(row_index, "D").Value < _ Cells(row_index + 1, "D").Value Then Cells(row_index + 1, "D").EntireRow.Insert _ (xlShiftDown) End If To: For row_index = lastrow - 1 To 2 Step -1 If Cells(row_index, "D").Value < _ Cells(row_index + 1, "D").Value Then Cells(row_index + 1, "D").EntireRow.Insert _ (xlShiftDown) Cells(row_index+1,1).Value = Cells(row_index +2,3).Value End If HTH, Bernie MS Excel MVP "Esrei" wrote in message ... Bit of a long one working on a priclist to be coppied and made presentable from a DB. Sheets("Prys berekening").Select Range("A1:N1").Copy Sheets("Cust price list").Select Range("A16").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Sheets("Prys berekening").Select Range("A2:N311").Select Application.CutCopyMode = False Selection.Copy Sheets("Cust price list").Select Range("A17").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Range("B:B,D:E,G:G,N:N").Delete Shift:=xlToLeft Dim row_index As Long Application.ScreenUpdating = False lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row For row_index = lastrow - 1 To 2 Step -1 If Cells(row_index, "D").Value < _ Cells(row_index + 1, "D").Value Then Cells(row_index + 1, "D").EntireRow.Insert _ (xlShiftDown) End If Next End Sub "Bernie Deitrick" wrote: Esrei, Post your old code. HTH, Bernie MS Excel MVP "Esrei" wrote in message ... I have a macro that insert a line every time the value in C changes. Now I want to add that it must put in the new row in A the text that is in C in the row just under this row. So This would be like a heading. Hope I am not too fuzzy. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy down - special to fill only the blank cells | Excel Discussion (Misc queries) | |||
copy visble cells at the subtotal level | Excel Worksheet Functions | |||
Activate a macro to insert a row and copy the formuals from the rows above to the blank row | Excel Discussion (Misc queries) | |||
Reporting of Empty Cells | Excel Worksheet Functions | |||
Macro to hide rows with empty cells | Excel Worksheet Functions |