Zanatos1986
New Member
- Joined
- Apr 15, 2010
- Messages
- 48
I have code that uses two drop down lists to determine which sheet to access in my workbook. These sheets have data that only exist on row A, From A1 to A##
I need to determine the last column being used to get my range (i.e. A1:A34), select and copy this range to past back on Sheet1
I have found numerous code to find the last column but I can never seem to select the cells I want. Any help would be great!
Private Sub Worksheet_Change(ByVal Target As Range)
' Select the XXX
If Target.Address = "$E$10" Then
Select Case Target.Value
Case "XXX"
Call Macro1
Case "XX"
Call Macro2
Case ""
Call Macro3
End Select
End If
' Select The XXXX
If Target.Address = "$E$12" Then
'MsgBox Target.Value
Sheets(Target.Value).Select
Dim lRow As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row
Range(ActiveCell, Range("A" & lRow)).Select
End If
End Sub
I need to determine the last column being used to get my range (i.e. A1:A34), select and copy this range to past back on Sheet1
I have found numerous code to find the last column but I can never seem to select the cells I want. Any help would be great!
Private Sub Worksheet_Change(ByVal Target As Range)
' Select the XXX
If Target.Address = "$E$10" Then
Select Case Target.Value
Case "XXX"
Call Macro1
Case "XX"
Call Macro2
Case ""
Call Macro3
End Select
End If
' Select The XXXX
If Target.Address = "$E$12" Then
'MsgBox Target.Value
Sheets(Target.Value).Select
Dim lRow As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row
Range(ActiveCell, Range("A" & lRow)).Select
End If
End Sub