Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Maddison Hughes   on Nov 13 In MS Office Category.

  
Question Answered By: Dot net Sachin   on Nov 13

I think you're using confusing terminology.
Are you using "userforms" or are you simply moving
data from one spreadsheet to another?

Next, where do your macros reside?

It sounds like you're trying to take data  from one file  and copy it
to several other files.

Let's say you have a file that contains your macros, and it is in a
file called "macrofile.xls".
Now, this macro opens a file called "formdata1.xls"
Once open, your macro can contain the line:
FileName1 = activeworkbook.name
SheetName1 = Activesheet.name
Then, you open  file #2 called "formdata2.xls"

your macro says:
workbook(activeworkbook.name).sheets(activesheet).cells(1,1) = _
workbook(FileName1).sheets(SheetName1).cells(1,1)


Doing this does not require you to "make form  1 active  again".

If, for some reason, you DO need to make the different workbooks "active",
you simply have to use something like:

workbooks(FileName1).activate

but I don't think you'll need that.


At first glance, the terminology you're using sounds like you're pulling  data
from a Userform in one file to dynamically create  a userform in another file.
which, can be done (I think) but the rest of your question leads me to believe
that you're just moving data from one spreadsheet to another.
Which is MUCH simpler.

If you give me some sample data, I'd be glad to throw something together for
you.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Activate Workbook by using a variable Or get search suggestion and latest updates.


Tagged: