J
Joe
Hi,
I have an Excel file where I need to compare any two worksheets
selected by any given user:
Is the following logic possible?
1. An input box asks the user to enter the name of the worksheet, and
the input gets stored as a Variant - I've already done this.
eg: User inputs "Jan06"
2. Now I want to reference the worksheet "Jan06".
eg: I want to say something like
If Worksheet.("Jan06").Cells(2,1) = "CAR122" then ..........
etc etc etc
I tried the following but it didnt work:
Sub Autopopulate()
Dim a, b, c As Variant
Dim Sourcesheet As String
Sourcesheet = Application.InputBox("Enter the exact name of the
worksheet to transfer data FROM", Title:="Input Worksheet name",
Type:=2)
Set SS = Application.Worksheets.Sourcesheet
........................................................
.............................................................
Endsub()
Can someone help please?
Thanks in advance,
Joe.
PS: Is there something like an Activesheet function to work it around ?
I have an Excel file where I need to compare any two worksheets
selected by any given user:
Is the following logic possible?
1. An input box asks the user to enter the name of the worksheet, and
the input gets stored as a Variant - I've already done this.
eg: User inputs "Jan06"
2. Now I want to reference the worksheet "Jan06".
eg: I want to say something like
If Worksheet.("Jan06").Cells(2,1) = "CAR122" then ..........
etc etc etc
I tried the following but it didnt work:
Sub Autopopulate()
Dim a, b, c As Variant
Dim Sourcesheet As String
Sourcesheet = Application.InputBox("Enter the exact name of the
worksheet to transfer data FROM", Title:="Input Worksheet name",
Type:=2)
Set SS = Application.Worksheets.Sourcesheet
........................................................
.............................................................
Endsub()
Can someone help please?
Thanks in advance,
Joe.
PS: Is there something like an Activesheet function to work it around ?