Save my internship

DNiersbach

New Member
Joined
Jul 15, 2015
Messages
27
Hey guys I'm new here and this is my first post.

I'm trying to write a macro that will enter data into a worksheet based on the values entered in the form. I've created the user form but the coding is giving me issues.

I'm trying to write a function that will activate the sheet matching the first two inputs before entering the rest of the data in the sheet.

For example,

B1=7/1/15 and C1=Name

How do I get the macro to activate sheet "Name 07-15" my matching the above cells?

Thank you!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Your earlier code works fine. This one won't do anything since you're no longer referencing sname.

What I mean by "The sname string and worksheet name need to be identical" is that whatever string the sname variable returns must exactly match the sheet name that you're trying to reference.

Let's say you have "John" in F1 and "07-15" in B1, giving you "John 07-15", but the sheet name is "John Doe 07-15", then the code will fail since there's no match. Hence the subscript out of range error, which means that Excel can't find the sheet name that you're trying to reference.
 
Upvote 0

Forum statistics

Threads
1,216,747
Messages
6,132,483
Members
449,729
Latest member
davelevnt

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