Demo Macro

EE Pros,

I have a Workbook that has multiple Worksheets.  One of the WSs is a Demo WS that has a list of content and which fields on which WSs the content should go when the Demo macro is triggered.  I've attached a strawman for you to take a look at to see what I'm trying to accomplish.  

The reason for separating out the Demo WS is that over time, I'll change the numbers and content but still want it to populate the WSs in the same locations.

Thank you in advance,

B.
Demo.xls
Bright01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
The macro is missing an "End With" and it's looking for a sheet named "Customer - Inputs" that doesn't exist, but ignoring that, what is it that you want to do?
Bright01Author Commented:
Martin,

Thanks for the response.  Delete anything in the module....that was my feeble attempt to start building a macro.   Then I got the inspiration to separate it out to a Demo Tab so it could quickly be changed.  That's when I authored the question.

What I'm trying to get done is when you fire the "Demo" macro, it populates the content (Demo Tab) into the specified Worksheets and fields identified.

Thanks again,

B.
Martin LissOlder than dirtCommented:
Try this
Q-28624123.xls

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Saurabh Singh TeotiaCommented:
Use this code...

Sub populate_data()
Dim ws As Worksheet, ws1 As Worksheet, ws2 As Worksheet

Set ws = Sheets("Demo")
Set ws1 = Sheets("Questions")
Set ws2 = Sheets("Splash")

ws2.Range("N12:N19").Value = ws.Range("M10:M17").Value
ws1.Range("B4").Value = ws.Range("M18").Value
ws1.Range("B7:B8").Value = ws.Range("M18:M19").Value

End Sub

Open in new window


Saurabh
Bright01Author Commented:
Martin,  I almost got it to work!  I have one little issue, if I need to simulate a double mouse click, in column O in the Demo Tab, is there a way to do that?  I have a reason for needing to do it because when a selection is actually done in the model, it causes a trigger for another macro.  So by simply sending the content over, it doesn't trigger the other macro.  Like in O18 (Demo Tab), instead of it reading send "2" to B4 in the Questions Tab, it would actually cause a double click action in B4 in the Questions tab?  In other words the content would actually be an action instead of a value.........

Saurabh, I think Martin's code gives me the flexibility I need for the task.  Thank you for adding an option.

B.
Martin LissOlder than dirtCommented:
Then add this code.

Range("B4").Select
Worksheet_BeforeDoubleClick ActiveCell, False
Bright01Author Commented:
Martin,

Sorry but I'm a little confused.  Let me explain this in a little more detail.  In my list in the Demo Tab, I have one set of references, where it is required that at least one of the references has a double click.  This is because in the production version (vs. the demo), you have to double click on a cell for a check mark to appear.   In order for the demo to work with the right content, I have to simulate a single check mark on one of the referenced cells.  

So your add above, where in the code do I put it?  And how does the macro know which content cell to act the double click on?  I don't want a double click on every sell....just one specific one that will trigger the macro in the production version to populate properly.

I hope that makes sense.

B.
Martin LissOlder than dirtCommented:
Do I assume correctly that in production that there won't be a button like the "Demo Button" button?

If that's true then what process populates the other sheets with the Demo sheet's information?

Where does the checkmark appear?

How do I tell which cell to double-click?

Could you possibly attach your production workbook?
Bright01Author Commented:
Martin,

Thank you very much!  Can I purchase an hour of time from you?

B.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.