number consequetively

J

Joe Schmoe

Is there a way to number items after I've pasted them into a new tab.
Unfortunately the data is not right next to the items I've pasted.

This pastes the items into Row 3 Column D ... but now I need to number these
items consequetively numbered beginning in Column B3.

Private Sub CommandButton1_Click()
'Application.ScreenUpdating = False
'Application.Calculation = xlCalculationManual
lastRow = Sheets("Input Names").Cells(Rows.Count, "C").End(xlUp).Row
Lastcolumn = Sheets("Input Names").Cells(1,
Columns.Count).End(xlToLeft).Column
With Sheets("Input Names")
.Range(.Cells(3, 3), .Cells(lastRow, Lastcolumn)).Copy
Sheets("Scores").Cells(3, 4)
End With
End Sub

Thanks again
 
B

B Lynn B

Add to the end of your sub after "end with"

Sheets("Scores").Range("B3") = 1
Sheets("Scores").Range("B4") = 2
Sheets("Scores").Range("B3:B4").AutoFill _
Destination:=Sheets("Scores").Range("B3:B" & LastRow)
 
J

JLGWhiz

I assume you want the enumeration in the sheet you pasted into.

Sub numb()
Dim lr As Long, rng As Range, sh As Worksheet
Dim c As Range
Set sh = Sheets(1)
lr = sh.Cells(Rows.Count, 3).End(xlUp).Row
Set rng = sh.Range("B4:B" & lr)
Range("B3").Value = 1
For Each c In rng
c = c.Offset(-1, 0).Value + 1
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top