Ask Experts Questions for FREE Help !
Ask
    nismyl's Avatar
    nismyl Posts: 2, Reputation: 1
    New Member
     
    #1

    Dec 23, 2010, 04:56 AM
    Checkboxes on a form
    Guys, How are you? I need some help.

    I have made a userform that have checkboxs. Each checkbox is representing the name of spreadsheet that a user may export or move to any other worksheet.

    Suppose there are three spreadsheets in an excel file. "A, B and C". I have made a userform that shows shows,

    Checkbox1 = A
    Checkbox2 = B
    Checkbox3 = C

    CmdButton "Export"

    If user will check on "A" and "C". Then only the checked sheets should be selected and exported.

    Direct code: Sheets(Array("A","C")).Select

    Please help me how should I define such array.

    Thanks
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Dec 23, 2010, 05:11 AM

    First its not a good idea to piggyback your question on someone else's. This can lead to confusion. You should start a new thread. So I've moved your question to its own thread in the appropriate forum.

    I would use a For... Next loop for this, checking to see if each the checkbox is checked then doing your export if it is.
    nismyl's Avatar
    nismyl Posts: 2, Reputation: 1
    New Member
     
    #3

    Dec 23, 2010, 06:57 AM
    My Apologies Scott, I shouldn't have post on someone else's thread.

    I have tried to use For.. Next loop but I am unable to use it properly.

    The scenario is that there are 3 sheets. If I have checked only 2 of them then only these two sheet will export. It means that the selection array will re-define every time. Please Help.

    Thank

    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Dec 23, 2010, 01:48 PM

    Post your code, lets see what you have.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

How far should an object be form a concave mirror of radius 0.36 m to form a real ima [ 1 Answers ]

How far should an object be form a concave mirror of radius 0.36 m to form a real image 1/9th of its size?

Does my wife also sign my w8ben form or does she file a separate form? [ 4 Answers ]

I want to cash in stocks I have with the united states and was told my wife and I need to file a w8ben form to avoid paying the tax, Do we sign the same form or do we both need to fill out the w8ben form separately?

Form 8223, form 8316 and form 843 for F-1 student (India) [ 1 Answers ]

Hi, I am an International student (from India) doing my MS in Computer Science in NY. I worked for a month on CPT in 2009 and I got a w-2 form from my employer recently. And I realized that my employer did withheld Medicare Tax and social Security Tax. And I asked him to refund the SS Tax and...

Need VBA syntax for looping through checkboxes with IF statements [ 7 Answers ]

The title explains it all. I need the command to loop through all of the checkboxes. There is also an IF command as well. Let me know! Rick

Form 1099 received, but do I report on Form 1040 or just Form 2106? [ 1 Answers ]

Greetings. I'm hoping I can get some help on what to do with a 1099-MISC form I received from my employer that were for business expense reimbursements. I have read through some questions and answers already and based on them I'm going to file this as a Form 2106. The question is should I...


View more questions Search