hi guys is it possible to work on a workbook lets call it 123
once macro button is pressed it opens workbook abc
then saves it as what ever is in cell a1 to a directory?
hi guys is it possible to work on a workbook lets call it 123
once macro button is pressed it opens workbook abc
then saves it as what ever is in cell a1 to a directory?
Which workbook are you saving & which workbook contains the name?
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
sorry roy
wasnt very specific was i
the workbook im working on is workbook "hello" so i will open that automatically , i will then go about my work and press macro button which should then open "please" from directory "C:\Documents and Settings\st\Desktop"
it will then copy cells a1 and b1 to the corresponing cells a1 and b1 in "please"
it then needs to save that "please" as whatever is in cell a1 so lets say cell a1 has abc123 in it
it will save the workbook as "abc123 - please" to the same directory
thank you
hi roy
this is the code i already have
which as you can already see it does open another workbook already
( i want it to open 2 and put different stuff into "please" and then rename it
Please Login or Register to view this content.
You have the code for opening & getting values, you just need to amend it to suit the other workbook.
You can then save the updated sheet like this
Please Login or Register to view this content.
thanks roy
will take a look when i have woken properly
roy or anyone kind enough to help
is it possible to use this line twice?
but to use a different workbook?Please Login or Register to view this content.
ie goodbye is the first one
then use please?
You can reset the variable wbTo later in the code if you want
Please Login or Register to view this content.
i dont quite fully understand what you are saying roy
can i use that line twice to open two workbooks at the same time?
No you need to use the variable to do the copying as in your code, then you can reset the variable as in my code extract. If yo change it to the second workbook then the code will ignore the first one opened.Otherwise you need a second variable wbToA or omething then use that
thanks roy for your help
i just understand what you are saying
not to worry thanks all the same
roy
i have got some of the way there
its all a lot of unnecessary coding probably but it seems to work
i have this so far
it opens both workbooks as required and transfers certain cells.
im still playing eith exactly what i need for each one.
Please Login or Register to view this content.
i dont understand
but some way or another ive managed to get it to do half what i want so i will try a bit more
Can you explain why you need to use it twice?
i need it to open two new workbooks so that it enters the data i need in the 2 seperate workbook as well as the curent workbook because they are diffe rent books used by different people and saves a lot of input time
So you want to open two workbooks & input the same data into both? Something like this might work, you will need to make the change where I have indicated & test it.
Please Login or Register to view this content.
hi roy
no
its not the same data but a variation of the same data
ie
there may be 50 cells of data in the original
i then use lets say 20 of the cells for workbook 1
and then 8 for workbook 2
the code i put up works
i just need it to save as specific now which is what im playing around with
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks