First time post, I am trying to write a program to allow a user to open an excel workbook into the current workbook.
First time post, I am trying to write a program to allow a user to open an excel workbook into the current workbook.
Please clarify what you mean by this. It is a confusing statement as this is not an event that happens in Excel. You can have more than one workbook open, or you can copy one workbook into another. I'm not sure what you want.open an excel workbook into the current workbook
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
You can try this code :
Please Login or Register to view this content.
I would like to be able to grab data from an existing excel workbook. So if I open the workbook with the vba code, there is a button that will allow the user to select which file is to be opened
This may be what you are looking for: http://analysistabs.com/vba/open-fil...-example-code/
this works in opening the file, but i would like the file to be opened into the workbook the macro is in.
I don't believe what you are asking is possible. You would have to copy the excel document you have on file and paste it into the new document.
Can you explain the business rationale of what you are wishing to happen. Perhaps if we understand the business scenario, we can offer a valid solution.
alansidman:
the rationale being there is an exported excel file(and future files) that needs to be reformatted. Below is the working code. it is able to insert a selected excel file into sheet 2, then transfer that data into sheet 1 were it will be properly reformatted
Please Login or Register to view this content.
Last edited by alansidman; 08-09-2016 at 09:01 PM.
Code Tags Added
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html
(Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
BTW: Your code does what I indicated had to happen. It opens a file, copies the sheet and pastes it into the new file. It does this with a loop that looks at each sheet and copies them into the new workbook.
Last edited by alansidman; 08-09-2016 at 09:04 PM.
thanks for the information Alansidman, the next step i wish to accomplish is to add functions to the newly copied sheet. for instance i wish to take the value of cell E2 multiply it by two and the multiply it be the first value in D2 (function looks like =2*E2*MID(D2,1,1). The issue I'm facing is that the function doesnt seem to work down the column it is in. it will return the same value, even if the values in D2 differ down the column
Since this is a new issue, I suggest that you mark this thread solved and open a new thread with your requirements. It will generate more responses than a long open unresolved thread.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks