Thread: Command button
View Single Post
  #1   Report Post  
Mark
 
Posts: n/a
Default Command button

Hi

If I have the following macro running in a workbook and I
add titles to cells A1 B1 C1 & D1 the first number will
appear in cell A2 when I click the command button however
the next number appear in cells D3, D4, D5 etc ?
Any suggestions welcome.


Option Explicit
Sub RCA()

ActiveSheet.UsedRange
If Range("A2").Value = "" Then
Range("A2").Value = InputBox("Enter starting
value")
Else
Range("A2").SpecialCells
(xlCellTypeLastCell).Offset(1, 0).Value =
Application.WorksheetFunction.Max(Range("A:A")) + 1
End If
End Sub


Thanks

Mark