In the given macro I want to insert an IF & ELSEIF condition at the aero mark location,
IF B4 is NOT EQUAL TO B5000 then it should continue as it is for next four lines.
ELSEIF B4 IS EQUAL TO B5000 then it should paste on same B4 instead of inserting and paste.
In other words, I want to save the data by inserting new row if the date is different otherwise without inserting paste on same line.
Please help me.
Can I have any link to learn how to insert condition step by step.
__________________________
Sub Macro1()
'
' Macro1 Macro
' Store Data
'
'
Rows("5000:5000").Select
Selection.Copy
Rows("4999:4999").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ScrollRow = 4
Add the if condition
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Rows("6:6").Select
Application.CutCopyMode = False
Selection.Copy
Rows("4:4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWindow.ScrollRow = 4999
Rows("5000:5000").Select
Selection.Delete Shift:=xlUp
Sheets("Manpower").Select
Range("A10").Activate
End Sub
IF B4 is NOT EQUAL TO B5000 then it should continue as it is for next four lines.
ELSEIF B4 IS EQUAL TO B5000 then it should paste on same B4 instead of inserting and paste.
In other words, I want to save the data by inserting new row if the date is different otherwise without inserting paste on same line.
Please help me.
Can I have any link to learn how to insert condition step by step.
__________________________
Sub Macro1()
'
' Macro1 Macro
' Store Data
'
'
Rows("5000:5000").Select
Selection.Copy
Rows("4999:4999").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ScrollRow = 4
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Rows("6:6").Select
Application.CutCopyMode = False
Selection.Copy
Rows("4:4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWindow.ScrollRow = 4999
Rows("5000:5000").Select
Selection.Delete Shift:=xlUp
Sheets("Manpower").Select
Range("A10").Activate
End Sub