• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Please help with shifting all data to the right by 1 column

Pat1009

New Member
I have a workbook with many worksheets. The worksheet named "Exceeds SLO Comments", I need to run my vba code and at the end, shift all data it ran to the right by 1 column.
This is basically a copy from 1 worksheet and paste to another based on some criteria.
I need to shift all the data to the right by 1 column when it pastes to the other worksheet, right now the vba below is working, but it pastes the data starting in Column A2.
I need it to start pasting in B3, can any vba master help?
This is what I have so far....
Code:
Sub Exceeds_SLO_Comments()
Dim i As Integer
Dim ws1 As Worksheet: Set ws1 = ThisWorkbook.Sheets("All Restoration Cases")
Dim ws2 As Worksheet: Set ws2 = ThisWorkbook.Sheets("Exceeds")

For i = 2 To ws1.Range("A" & Rows.Count).End(xlUp).Row
    If ws1.Cells(i, 4) = "A" And ws1.Cells(i, 12) > 240 And ws1.Cells(i, 14) = "Standard" Then _
      ws1.Range("A" & i & ":R" & i).Copy ws2.Rows(ws2.Cells(ws2.Rows.Count, 3).End(xlUp).Row + 1)
 
Hi:

If B3 is an absolute reference why can't you make the same in your code. As per my understanding you are trying to paste the data in the last row + 1 of your second workbook, if you need more precise solution you may have to upload your workbook .

Thanks
 
Back
Top