ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count up (https://www.excelbanter.com/excel-programming/299214-count-up.html)

gavmer[_21_]

Count up
 
Hi all,

The following code copies/pastes data and assigns an item number one b
one. Only problem is, when the pasted info is viewed, the item number
run highest to lowest down the column. IE

12
11
10

How can i reverse the order number so that it counts up. IE

1
2
3
4

Cheers all!!!!

--
Message posted from http://www.ExcelForum.com


gavmer[_22_]

Count up
 
oops,sorry all, heres the code!!!!!

Sub CopyData()
Dim wsFedex As Worksheet
Dim wsquote As Worksheet

Set wsFedex = Worksheets("FEDEX calculator")
Set wsquote = Worksheets("quote")

With wsFedex

.Range("A19:E19").Copy
wsquote.Cells(21, "A").PasteSpecial xlPasteValues

.Range("H19").Copy
wsquote.Cells(21, "F").PasteSpecial xlPasteValues

.Range("J19").Copy
wsquote.Cells(21, "G").PasteSpecial xlPasteValues

.Range("D13").Value = .Range("D13").Value + 1
Application.CutCopyMode = False
wsquote.Rows(21).Insert
End With

End Su

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com