DataBlake
Well-known Member
- Joined
- Jan 26, 2015
- Messages
- 781
- Office Version
- 2016
- Platform
- Windows
I have a sheet macro on a sheet named "Program Start" that opens various userforms based on which cells are clicked as well as switches off the sheet. When the userform portion of the code is completed it returns the sheet selection back to Program Start.
I would like a file named the same thing as the cell (i.e J2 = RTH) in a specific folder:
C:\Users\user\Desktop\Excel Program\Update INV\Spec Sheets\
to be copied to the activesheet in the workbook with the import sub.
So lets say i doubleclick I2: it would select sheet W1
then import the data from the Spec Sheets folder named W1.xlsx (whatever the first sheet is)
so the end result would be
any help would be greatly appreciated because i can't quite nail this
Code:
If Target.Address = "$H$2" Then
Sheets("TSS").Select
TSS.Show
Sheets("Program Start").Select
End If
If Target.Address = "$I$2" Then
Sheets("W1").Select
W1.Show
Sheets("Program Start").Select
End If
If Target.Address = "$J$2" Then
Sheets("RTH").Select
RTH.Show
Sheets("Program Start").Select
End If
I would like a file named the same thing as the cell (i.e J2 = RTH) in a specific folder:
C:\Users\user\Desktop\Excel Program\Update INV\Spec Sheets\
to be copied to the activesheet in the workbook with the import sub.
So lets say i doubleclick I2: it would select sheet W1
then import the data from the Spec Sheets folder named W1.xlsx (whatever the first sheet is)
so the end result would be
Code:
If Target.Address = "$H$2" Then
Sheets("TSS").Select
Call IMPORTats
TSS.Show
Sheets("Program Start").Select
End If
If Target.Address = "$I$2" Then
Sheets("W1").Select
Call IMPORTats
W1.Show
Sheets("Program Start").Select
End If
If Target.Address = "$J$2" Then
Sheets("RTH").Select
Call IMPORTats
RTH.Show
Sheets("Program Start").Select
End If
any help would be greatly appreciated because i can't quite nail this
Last edited: