Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Drop down list in macro

  1. #11
    Guest

    Default

    Ok, sorry for the incompetence on my part, but yet another question. I tried what you suggested, but now I'm having a problem with the following line:

    ChooseSheet = Worksheets(cb.Caption).Value

    which is in MY macro that i called from your code. How do i make a reference to something from your code from my macro? I have to use the sheet name in my code as thats what it does. Hopefully this will be my last question Thanks very much for the help.

  2. #12
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Anon,

    No problemo. It seems to me you should be in the sheet you're adjusting; accordingly, I would change (in your macro):

    ChooseSheet = Worksheets(cb.Caption).Value

    to

    ChooseSheet = activesheet.name

    Me thinks this ought to work.

    Cheers,

    Nate

  3. #13
    Guest

    Default

    Finally!! it works great, thanks very much

  4. #14
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Nice! Glad to hear it.

    Happy hunting. Cheers, Nate

  5. #15
    New Member
    Join Date
    Feb 2005
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello,

    I modified this so that it will delete unchecked sheets, but when I run the macro, excel gives me an "Are you sure....you want to delete" message. How can I get rid of that message so it automatically deletes them without the prompt?

    Code:
    CurrentSheet2.Select
        Application.ScreenUpdating = True
        If SheetCount <> 0 Then
            If PrintDlg.Show Then
                For Each cb In PrintDlg.CheckBoxes
                    If cb.Value = xlOff Then
                    Worksheets(cb.Caption).Delete
                    'Application.Run ("MAC
                    End If
                Next cb
            End If
        End If
    Thanks

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •