Multiple cells to one

B

Btobin0

I am trying to get cell A1 to be A2 through A31. I want to be able to select
A3 and A1 changes to it.
 
K

KellTainer

Hi

You can do this programmatically through VBA. Use this in the shee
object that enforces this behavior.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.ActiveCell.column = 1 And Application.ActiveCell.ro
1 And Application.ActiveCell.row < 32 Then
Application.ActiveSheet.Range("A1").Value
Application.ActiveCell.Value
End If
End Su
 
B

Btobin0

That errored out. Idid get this to work.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.ActiveCell.Column = 1 And Application.ActiveCell.Row < 32 Then
Application.ActiveSheet.Range("A1").Value = Application.ActiveCell.Value
End If
End Sub
 
B

Btobin0

Btobin0 said:
That errored out. I did get this to work. but still did not change any values

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.ActiveCell.Column = 1 And Application.ActiveCell.Row < 32 Then
Application.ActiveSheet.Range("A1").Value = Application.ActiveCell.Value
End If
End Sub
 
K

KellTainer

Thats weird. I double check the code by creating sample file and dumping
the vba back in and it does work. Send your file to my email @
[email protected] and I will see what I can do.
 
R

Ron Rosenfeld

I am trying to get cell A1 to be A2 through A31. I want to be able to select
A3 and A1 changes to it.

Try this worksheet code.

To enter the code, right-click on the sheet tab and select View Code.

Then paste this code into the module that opens:

==========================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim AOI As Range
Set AOI = [A3:A31]

If Not Intersect(Target, AOI) Is Nothing Then
[a1].Value = Target.Value
End If

End Sub
===========================


--ron
 
Top