Pass Info From Userform to VBA Excel 2007

I can search this stuff, but always end up with specific code that I can't figure out how to alter. So... I guess I need some specific code.

I have 5 column headings; only one printer may be selected.
F1 = Receipt at Main
G1 = Remote 1
H1 = Remote 2
I1 = Remote 3
J1 = Remote 4

I have several values in Column A; either or both Food and Alcohol may be selected.
11 = Food
12 = Alcohol
13 = Alcohol
15 = Alcohol

I need a plain old x in the printer's column of any rows that contain the corresponding values in Column A.

Clear as mud?

If anyone finds this easier to do with the actual file, I'm happy to email it privately. I'm sorry I can't upload it here for confidentiality reasons.

Thanks so much in advance for your help!

userform.png
LVL 22
Anne TroyEast Coast ManagerAsked:
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.

Saqib Husain, SyedEngineerCommented:
You can find my email on my profile
0
Anne TroyEast Coast ManagerAuthor Commented:
Thank you. I have sent it.
0
Roy CoxGroup Finance ManagerCommented:
You shoyuld remove any confidential data and post the workbook here
0
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Saqib Husain, SyedEngineerCommented:
I found no file there
0
Saqib Husain, SyedEngineerCommented:
Try this code in the Userform1 module

Private Sub CommandButton1_Click()
Dim cel As Range
Dim ws As Worksheet
Set ws = Worksheets("EnterData")
For Each cel In ws.Range("A2:A" & Range("A2").End(xlDown).Row)
'cel.Offset(, 5).Resize(, 5).ClearContents
Select Case cel.Value
    Case 11
        If CheckBox1 Then markprinter cel
    Case 12, 13, 15
        If CheckBox2 Then markprinter cel
End Select
Next cel
End Sub
Sub markprinter(cel As Range)
cel.Offset(, 5).Resize(, 5).ClearContents
If OptionButton1 Then cel.Offset(, 6).Value = "x"
If OptionButton2 Then cel.Offset(, 7).Value = "x"
If OptionButton3 Then cel.Offset(, 8).Value = "x"
If OptionButton4 Then cel.Offset(, 9).Value = "x"
If OptionButton5 Then cel.Offset(, 5).Value = "x"
End Sub
0
Anne TroyEast Coast ManagerAuthor Commented:
Saqib, your code works near perfectly.  I tried to get rid of the .ClearContents, but I get an error then. I don't really want it to change anything that's already in that range F:J that might already exist.

Mr Wolfe: Thank you. It would have taken me hours to un-confidentialize (LOL) the workbook. Next time, I will just ask at some other site.
0
Saqib Husain, SyedEngineerCommented:
Hi, All you had to do was get rid of the entire line which has .ClearConntents. There are two such lines one of which is already commented out.
0

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
Roy CoxGroup Finance ManagerCommented:
I have run Forums as admin and moderated several Excel Forums and believe me this is Forum  exceptionally well run. All forums operate a similar requirement - all questions and answers should be in the public forums, otherwise pay someone to help you!
0
Anne TroyEast Coast ManagerAuthor Commented:
I did a couple years here myself, Roy, and created vbaexpress.com. I know all about how it *should* be in a perfect world.
0
Anne TroyEast Coast ManagerAuthor Commented:
This worked perfectly for me. I did comment out that line while waiting for your response (to ensure I fixed it), but didn't think to try it without it.
0
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.