Help To Edit This

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
Right now this code first pastes into the target sheet ROW 2, What changes this to ROW 3? Thanks

Code:
Sub BreakoutReDux()
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Sheets(2)
ws.Select
TrackCol = 7 ' Use this to set the tracking column as you like.
'Set up a tracking column
Cells(2, TrackCol) = "Status"
'Determine how many rows of data we have
lastrow = Range("A32000").End(xlUp).Row
lastpostedrow = Cells(32000, TrackCol).End(xlUp).Row
'Got back to the primary-sheet2
ws.Activate
'Start looping through rows and copy to target sheet
For RowIdx = lastpostedrow + 1 To lastrow
    Range("A" & RowIdx).Select
    
    'Only copy if col A is a value > 0, else skip it
    If Range("A" & RowIdx).Value > 0 Then
        tgtsht = Asc(UCase(Range("A" & RowIdx).Value)) - 62
        tgtRow = Sheets(tgtsht).Range("A30000").End(xlUp).Row + 1
        
         Range("A" & RowIdx).Offset(0, 1).Copy 'Sheets(tgtsht).Range("A" & tgtRow)
         Sheets(tgtsht).Range("A" & tgtRow).PasteSpecial (x1PasteValues)
         
         Range("A" & RowIdx).Offset(0, 2).Copy 'Sheets(tgtsht).Range("B" & tgtRow)
        Sheets(tgtsht).Range("B" & tgtRow).PasteSpecial (x1PasteValues)
         
         Range("A" & RowIdx).Offset(0, 3).Copy 'Sheets(tgtsht).Range("C" & tgtRow)
        Sheets(tgtsht).Range("C" & tgtRow).PasteSpecial (x1PasteValues)
         
         
         Range("A" & RowIdx).Offset(0, 4).Copy 'Sheets(tgtsht).Range("D" & tgtRow)
         Sheets(tgtsht).Range("D" & tgtRow).PasteSpecial (x1PasteValues)
         
        Range("A" & RowIdx).Offset(0, TrackCol - 1) = "Posted"
    Else    'skip it and indicate as such
        ws.Range("A" & RowIdx).Offset(0, TrackCol - 1) = "Skipped"
    End If
Next RowIdx
'Go back to the first sheet
ws.Select
Set ws = Nothing
Application.ScreenUpdating = True
End Sub

Thanks for the help!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,597
Messages
6,179,812
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top