Simple code help an old man

oldmanwilly

Board Regular
Joined
Feb 24, 2016
Messages
221
HI There

M steps fr my code are:

Code:
Sub GET_IOR_DIAGNOSTIC_DATA()
'OPEN FOLDER
Dim myfile As String

On Error GoTo 100
Dir "I:\Blenheim House\Analytics\North Region Report Library\StEIS\STEIS Tool"

myfile = Application.GetOpenFilename
Workbooks.Open (myfile)
100: Exit Sub

'MSGBOX SELECT FILE

MsgBox "please select your file"


'AFTER OPEN,  SELECT FROM the 3 seperate drop downs: NORTH, STP, AND THEn for the last drop down MATCH THE SELECTION ON my sheet

'GO TO THE CCG SHEET AND COPY
ActiveWorkbook.Sheets("sheetname").Select
Cells("a1:s28").Copy


'CLOSE THE SHEET but keep clipboard
ActiveWorkbook.Close
Application.CutCopyMode = False


'GO TO OUR SHEET AND PASTE
Workbook("myworkbook").Activate
Sheets("my sheet").Select
Cells("a1").Activate
ActiveCell.Paste

'END

I have no idea how to open simple folder the open the selected file, i tried changing it to chdir but it does not help.
thks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Can you open the file directly without opening the folder? Something like:

Code:
Dim wb As Workbook

set wb = Workbooks.Open(Filename:=mypath & "\" & myfile)
 
Upvote 0
Can you open the file directly without opening the folder? Something like:

Code:
Dim wb As Workbook

set wb = Workbooks.Open(Filename:=mypath & "\" & myfile)

Hi

the filename changes every month. need to just open the folder any ideas? I also need to know how to change the option froma drop down menu based on a value in my
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top