Hi all,
I'm new to VBA but I can hold my own explaining what i'm looking for. I'm going to refer to the picture below to help explain.
I am trying to be able to click on a cell in the "Area" Column of the sheet "Zone 1" and have the contents of that clicked cell (ie. 101, 205, etc.) immediately redirect me to worksheet "S11" and paste the value of the clicked cell into the white box beside the word 'area'.
in short- in one click for specific column cells:
Copy clicked cell
Select sheet S11
Select cell (C2)
Paste Special - paste as values.
I have tried this technique thus far:
On the Zone1 worksheet
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$5" Then
ActiveCell.Copy
Sheets("S11-Area Lookup").Select
End If
End Sub
So when the re-direct enters the 'S11' sheet
Private Sub Worksheet_Activate()
Range("C2").Select
ActiveSheet.PasteSpecial xlPasteValues
End Sub
This is not what I really want however because then if i go back to check my data on the tab it tries to paste without anything selected and gives me a run-time error: method of pastespecial of object 'worksheet' failed.
I had also made the the 'S11' code specific to "If ActiveRange = "C2" Then" which then causes the same empty clipboard errors as the other procedure.
So in conclusion,
I think the vba code needs to be workbook specific and in one coding: for column A, rows 4-200, on Sheets labeled Zone1[zone2...zone7] to copy the cell, select worksheet 's11', select 'S11'!C2, .pastespecial xlpastevalues.
I could really use help with this as i have the most excel skills of anyone in my office and this is new to me.
I am using Excel 2007.
Thanks,
Henry
I'm new to VBA but I can hold my own explaining what i'm looking for. I'm going to refer to the picture below to help explain.
I am trying to be able to click on a cell in the "Area" Column of the sheet "Zone 1" and have the contents of that clicked cell (ie. 101, 205, etc.) immediately redirect me to worksheet "S11" and paste the value of the clicked cell into the white box beside the word 'area'.
in short- in one click for specific column cells:
Copy clicked cell
Select sheet S11
Select cell (C2)
Paste Special - paste as values.
I have tried this technique thus far:
On the Zone1 worksheet
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$5" Then
ActiveCell.Copy
Sheets("S11-Area Lookup").Select
End If
End Sub
So when the re-direct enters the 'S11' sheet
Private Sub Worksheet_Activate()
Range("C2").Select
ActiveSheet.PasteSpecial xlPasteValues
End Sub
This is not what I really want however because then if i go back to check my data on the tab it tries to paste without anything selected and gives me a run-time error: method of pastespecial of object 'worksheet' failed.
I had also made the the 'S11' code specific to "If ActiveRange = "C2" Then" which then causes the same empty clipboard errors as the other procedure.
So in conclusion,
I think the vba code needs to be workbook specific and in one coding: for column A, rows 4-200, on Sheets labeled Zone1[zone2...zone7] to copy the cell, select worksheet 's11', select 'S11'!C2, .pastespecial xlpastevalues.
I could really use help with this as i have the most excel skills of anyone in my office and this is new to me.
I am using Excel 2007.
Thanks,
Henry