Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default number consequetively

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default number consequetively

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)


"Joe Schmoe" wrote:

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

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default number consequetively

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



"Joe Schmoe" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
Inserting a number of rows based on the number of columns filled bytext values zorakramone Excel Programming 4 August 3rd 09 08:21 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"