groovygarden
Programmer
- Aug 23, 2001
- 63
I've been asked (joy of joys) to modify someone's VB code.
There is a problem with one of the modules which works with an Excel spreadsheet. The module is designed to place a serial number in column A in the next row down from the previously active cell. However, instead of putting the serial number in the next row down, the serial number is appearing in column A, but about 33,000 rows down!
Does anyone have an idea why this is happening? The code is below.
Many thanks in advance
Code:
Sub installNew(serial)
' routine to install data onto the "New Installs" worksheet
Dim serialNew As String
serialNew = serial
Worksheets("New-Installs").Activate
Selection.SpecialCells(xlCellTypeLastCell).Select
' this finds last used cell
ActiveCell.Offset(1, -10).Value = serial
ActiveCell.Offset(1, -10).Activate
' this puts the serial number in the next row down and sets that cell as active