Master Work
asked on
I need to insert after every single raw the value from the third column like the sheet1 attached.
I need to insert after every single raw the value from the third column like the sheet1 attached.
Regards,
Dallag
insert_every_sngle_raw.xlsx
Regards,
Dallag
insert_every_sngle_raw.xlsx
Would you show source and result on separate sheets?
Please try this...
insert_every_sngle_raw.xlsm
Sub InsertRow()
Dim wsData As Worksheet
Dim lr As Long, i As Long
Application.ScreenUpdating = False
Set wsData = Worksheets("Sheet1")
lr = wsData.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
wsData.Rows(i).Insert
wsData.Cells(i, 1).Value = wsData.Cells(i + 1, 1) & wsData.Cells(i + 1, 4)
Next i
Application.ScreenUpdating = True
End Sub
Click the button called "Insert Rows" on Sheet1 to run the code.insert_every_sngle_raw.xlsm
insert after every single raw the value from the third columnIn your sample row s are inserted before rows. Is it correct?
"ps " and value from column D should be inserted?
Please replace line#10 with the following line...
wsData.Cells(i, 1).Value = "ps" & wsData.Cells(i + 1, 4)
insert_every_sngle_raw.xlsm
ASKER
can I have the result in a different sheet?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.