help with VB/Macro to shift cells
'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "A1"
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Range("A2:A10").Copy Range("A3:A11")
Range("A2").Value = Target.Value
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
Bob Phillips
(remove xxx from email address if mailing direct)
wrote in message
oups.com...
Hello -
I have a basic spreadsheet with the following information. Cells
A2:A11 contain basic number valus. Cell A1 is blank.
What I would like to accomplish is for a user to enter a value into
cell A1 and have that information replace the value in A2 and shift the
rest of the values in the column down. I only want to store 10 numbers
(ie A2:A11) at a time.
Can anyone provide me with the knowledge on how to accomplish this?
Thanks!
|