+ Reply to Thread
Results 1 to 13 of 13

select method of range class fails

Hybrid View

  1. #1
    mark kubicki
    Guest

    select method of range class fails

    select method of range class fails (AUGHHH!!!)
    sheet is unprotected
    sheet has a control button "cbGenerateIssue"
    code had been created by recording a macro (where it worked...)
    select fails even if control button , which calls the code, has not yet been
    deleted


    Private Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Select
    Sheets("Issue worksheet").Copy Before:=Sheets(1)
    Sheets("Issue worksheet (2)").Select
    Sheets("Issue worksheet (2)").Name = "1st Issue"
    ActiveSheet.Shapes("cbReformat").Select
    Selection.Delete
    ActiveSheet.Shapes("cbGenerateIssue").Select
    Selection.Delete
    ' --------> this next line fails (or any variation of it)
    Rows("5:7").Select



    had tried some variations:
    ...Sheets("1st Issue).Rows("5...
    ...put the select into a function
    ... moved the calling control deletion to after select...
    nothing

    thanks in advance,
    mark



  2. #2
    Glenn Ray
    Guest

    RE: select method of range class fails

    This should work:
    Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Copy Before:=Sheets(1)
    With Sheets(1)
    .Name = "1st Issue"
    .Shapes("cbReformat").Delete
    .Shapes("cbGenerateIssue").Delete
    End With
    Rows("5:7").Select
    End Sub

    It will only work once. If you try it again, it will halt when it tries to
    rename the new sheet "1st Issue", which would already exist. You could
    insert code to remove any existing sheet with that name first.

    -Glenn Ray


    "mark kubicki" wrote:

    > select method of range class fails (AUGHHH!!!)
    > sheet is unprotected
    > sheet has a control button "cbGenerateIssue"
    > code had been created by recording a macro (where it worked...)
    > select fails even if control button , which calls the code, has not yet been
    > deleted
    >
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Rows("5:7").Select
    >
    >
    >
    > had tried some variations:
    > ...Sheets("1st Issue).Rows("5...
    > ...put the select into a function
    > ... moved the calling control deletion to after select...
    > nothing
    >
    > thanks in advance,
    > mark
    >
    >
    >


  3. #3
    mark kubicki
    Guest

    Re: select method of range class fails

    sorry... but it doesn't for me...



    "Glenn Ray" <GlennRay@discussions.microsoft.com> wrote in message
    news:9D3D2B70-2CC8-4159-A424-CFEFCE8C83E9@microsoft.com...
    > This should work:
    > Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > With Sheets(1)
    > .Name = "1st Issue"
    > .Shapes("cbReformat").Delete
    > .Shapes("cbGenerateIssue").Delete
    > End With
    > Rows("5:7").Select
    > End Sub
    >
    > It will only work once. If you try it again, it will halt when it tries

    to
    > rename the new sheet "1st Issue", which would already exist. You could
    > insert code to remove any existing sheet with that name first.
    >
    > -Glenn Ray
    >
    >
    > "mark kubicki" wrote:
    >
    > > select method of range class fails (AUGHHH!!!)
    > > sheet is unprotected
    > > sheet has a control button "cbGenerateIssue"
    > > code had been created by recording a macro (where it worked...)
    > > select fails even if control button , which calls the code, has not yet

    been
    > > deleted
    > >
    > >
    > > Private Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Select
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > Sheets("Issue worksheet (2)").Select
    > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > ActiveSheet.Shapes("cbReformat").Select
    > > Selection.Delete
    > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > Selection.Delete
    > > ' --------> this next line fails (or any variation of it)
    > > Rows("5:7").Select
    > >
    > >
    > >
    > > had tried some variations:
    > > ...Sheets("1st Issue).Rows("5...
    > > ...put the select into a function
    > > ... moved the calling control deletion to after select...
    > > nothing
    > >
    > > thanks in advance,
    > > mark
    > >
    > >
    > >




  4. #4
    Glenn Ray
    Guest

    Re: select method of range class fails

    Is the error occurring at the same line in the code (Rows("5:7").Select) ?
    Is the error the same (select method of range class fails)?

    What if you inserted a message box before the select:

    MsgBox "New Sheet inserted."
    Rows("5:7").Select

    Just curious if you get an error at the message box command or the select
    command. The subroutine worked fine for me.
    -Glenn

    "mark kubicki" wrote:

    > sorry... but it doesn't for me...
    >
    >
    >
    > "Glenn Ray" <GlennRay@discussions.microsoft.com> wrote in message
    > news:9D3D2B70-2CC8-4159-A424-CFEFCE8C83E9@microsoft.com...
    > > This should work:
    > > Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > With Sheets(1)
    > > .Name = "1st Issue"
    > > .Shapes("cbReformat").Delete
    > > .Shapes("cbGenerateIssue").Delete
    > > End With
    > > Rows("5:7").Select
    > > End Sub
    > >
    > > It will only work once. If you try it again, it will halt when it tries

    > to
    > > rename the new sheet "1st Issue", which would already exist. You could
    > > insert code to remove any existing sheet with that name first.
    > >
    > > -Glenn Ray
    > >
    > >
    > > "mark kubicki" wrote:
    > >
    > > > select method of range class fails (AUGHHH!!!)
    > > > sheet is unprotected
    > > > sheet has a control button "cbGenerateIssue"
    > > > code had been created by recording a macro (where it worked...)
    > > > select fails even if control button , which calls the code, has not yet

    > been
    > > > deleted
    > > >
    > > >
    > > > Private Sub cbGenerateIssue_Click()
    > > > Sheets("Issue worksheet").Select
    > > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > > Sheets("Issue worksheet (2)").Select
    > > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > > ActiveSheet.Shapes("cbReformat").Select
    > > > Selection.Delete
    > > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > > Selection.Delete
    > > > ' --------> this next line fails (or any variation of it)
    > > > Rows("5:7").Select
    > > >
    > > >
    > > >
    > > > had tried some variations:
    > > > ...Sheets("1st Issue).Rows("5...
    > > > ...put the select into a function
    > > > ... moved the calling control deletion to after select...
    > > > nothing
    > > >
    > > > thanks in advance,
    > > > mark
    > > >
    > > >
    > > >

    >
    >
    >


  5. #5
    mark kubicki
    Guest

    Re: select method of range class fails

    the error is at the command (the box displays without a problem)



    "Glenn Ray" <GlennRay@discussions.microsoft.com> wrote in message
    news:3801AC3B-B7C4-483E-BD19-548415227266@microsoft.com...
    > Is the error occurring at the same line in the code (Rows("5:7").Select) ?
    > Is the error the same (select method of range class fails)?
    >
    > What if you inserted a message box before the select:
    >
    > MsgBox "New Sheet inserted."
    > Rows("5:7").Select
    >
    > Just curious if you get an error at the message box command or the select
    > command. The subroutine worked fine for me.
    > -Glenn
    >
    > "mark kubicki" wrote:
    >
    > > sorry... but it doesn't for me...
    > >
    > >
    > >
    > > "Glenn Ray" <GlennRay@discussions.microsoft.com> wrote in message
    > > news:9D3D2B70-2CC8-4159-A424-CFEFCE8C83E9@microsoft.com...
    > > > This should work:
    > > > Sub cbGenerateIssue_Click()
    > > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > > With Sheets(1)
    > > > .Name = "1st Issue"
    > > > .Shapes("cbReformat").Delete
    > > > .Shapes("cbGenerateIssue").Delete
    > > > End With
    > > > Rows("5:7").Select
    > > > End Sub
    > > >
    > > > It will only work once. If you try it again, it will halt when it

    tries
    > > to
    > > > rename the new sheet "1st Issue", which would already exist. You

    could
    > > > insert code to remove any existing sheet with that name first.
    > > >
    > > > -Glenn Ray
    > > >
    > > >
    > > > "mark kubicki" wrote:
    > > >
    > > > > select method of range class fails (AUGHHH!!!)
    > > > > sheet is unprotected
    > > > > sheet has a control button "cbGenerateIssue"
    > > > > code had been created by recording a macro (where it worked...)
    > > > > select fails even if control button , which calls the code, has not

    yet
    > > been
    > > > > deleted
    > > > >
    > > > >
    > > > > Private Sub cbGenerateIssue_Click()
    > > > > Sheets("Issue worksheet").Select
    > > > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > > > Sheets("Issue worksheet (2)").Select
    > > > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > > > ActiveSheet.Shapes("cbReformat").Select
    > > > > Selection.Delete
    > > > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > > > Selection.Delete
    > > > > ' --------> this next line fails (or any variation of it)
    > > > > Rows("5:7").Select
    > > > >
    > > > >
    > > > >
    > > > > had tried some variations:
    > > > > ...Sheets("1st Issue).Rows("5...
    > > > > ...put the select into a function
    > > > > ... moved the calling control deletion to after select...
    > > > > nothing
    > > > >
    > > > > thanks in advance,
    > > > > mark
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  6. #6
    Don Guillett
    Guest

    Re: select method of range class fails

    Mark

    Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Copy Before:=Sheets(1).Name = "1st Issue"

    with sheets("1st Issue")
    .Shapes("cbReformat").Delete
    .Shapes("cbGenerateIssue").Delete
    'you shouldn't need to select but you don't say what is next
    .select
    .Rows("5:7").Select
    end with

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    news:eLVnFwpSFHA.1040@TK2MSFTNGP10.phx.gbl...
    > select method of range class fails (AUGHHH!!!)
    > sheet is unprotected
    > sheet has a control button "cbGenerateIssue"
    > code had been created by recording a macro (where it worked...)
    > select fails even if control button , which calls the code, has not yet

    been
    > deleted
    >
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Rows("5:7").Select
    >
    >
    >
    > had tried some variations:
    > ...Sheets("1st Issue).Rows("5...
    > ...put the select into a function
    > ... moved the calling control deletion to after select...
    > nothing
    >
    > thanks in advance,
    > mark
    >
    >




  7. #7
    mark kubicki
    Guest

    Re: select method of range class fails

    sorry to say, but that didn't work either...



    "Don Guillett" <donaldb@281.com> wrote in message
    news:OYrjw$pSFHA.3184@TK2MSFTNGP15.phx.gbl...
    > Mark
    >
    > Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Copy Before:=Sheets(1).Name = "1st Issue"
    >
    > with sheets("1st Issue")
    > .Shapes("cbReformat").Delete
    > .Shapes("cbGenerateIssue").Delete
    > 'you shouldn't need to select but you don't say what is next
    > .select
    > .Rows("5:7").Select
    > end with
    >
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    > news:eLVnFwpSFHA.1040@TK2MSFTNGP10.phx.gbl...
    > > select method of range class fails (AUGHHH!!!)
    > > sheet is unprotected
    > > sheet has a control button "cbGenerateIssue"
    > > code had been created by recording a macro (where it worked...)
    > > select fails even if control button , which calls the code, has not yet

    > been
    > > deleted
    > >
    > >
    > > Private Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Select
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > Sheets("Issue worksheet (2)").Select
    > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > ActiveSheet.Shapes("cbReformat").Select
    > > Selection.Delete
    > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > Selection.Delete
    > > ' --------> this next line fails (or any variation of it)
    > > Rows("5:7").Select
    > >
    > >
    > >
    > > had tried some variations:
    > > ...Sheets("1st Issue).Rows("5...
    > > ...put the select into a function
    > > ... moved the calling control deletion to after select...
    > > nothing
    > >
    > > thanks in advance,
    > > mark
    > >
    > >

    >
    >




  8. #8
    Don Guillett
    Guest

    Re: select method of range class fails

    try it this way

    Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Copy Before:=Sheets(1)
    with activesheet
    .Name = "1st Issue"
    .Shapes("cbReformat").Delete
    .Shapes("cbGenerateIssue").Delete
    'you shouldn't need to select but you don't say what is next
    .select
    .Rows("5:7").Select
    end with



    Don Guillett
    SalesAid Software
    donaldb@281.com
    "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    news:u0j4ZLqSFHA.3840@tk2msftngp13.phx.gbl...
    > sorry to say, but that didn't work either...
    >
    >
    >
    > "Don Guillett" <donaldb@281.com> wrote in message
    > news:OYrjw$pSFHA.3184@TK2MSFTNGP15.phx.gbl...
    > > Mark
    > >
    > > Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1).Name = "1st Issue"
    > >
    > > with sheets("1st Issue")
    > > .Shapes("cbReformat").Delete
    > > .Shapes("cbGenerateIssue").Delete
    > > 'you shouldn't need to select but you don't say what is next
    > > .select
    > > .Rows("5:7").Select
    > > end with
    > >
    > > --
    > > Don Guillett
    > > SalesAid Software
    > > donaldb@281.com
    > > "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    > > news:eLVnFwpSFHA.1040@TK2MSFTNGP10.phx.gbl...
    > > > select method of range class fails (AUGHHH!!!)
    > > > sheet is unprotected
    > > > sheet has a control button "cbGenerateIssue"
    > > > code had been created by recording a macro (where it worked...)
    > > > select fails even if control button , which calls the code, has not

    yet
    > > been
    > > > deleted
    > > >
    > > >
    > > > Private Sub cbGenerateIssue_Click()
    > > > Sheets("Issue worksheet").Select
    > > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > > Sheets("Issue worksheet (2)").Select
    > > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > > ActiveSheet.Shapes("cbReformat").Select
    > > > Selection.Delete
    > > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > > Selection.Delete
    > > > ' --------> this next line fails (or any variation of it)
    > > > Rows("5:7").Select
    > > >
    > > >
    > > >
    > > > had tried some variations:
    > > > ...Sheets("1st Issue).Rows("5...
    > > > ...put the select into a function
    > > > ... moved the calling control deletion to after select...
    > > > nothing
    > > >
    > > > thanks in advance,
    > > > mark
    > > >
    > > >

    > >
    > >

    >
    >




  9. #9
    Jim Thomlinson
    Guest

    RE: select method of range class fails

    Try re-selecting the sheet...

    Private Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Select
    Sheets("Issue worksheet").Copy Before:=Sheets(1)
    Sheets("Issue worksheet (2)").Select
    Sheets("Issue worksheet (2)").Name = "1st Issue"
    ActiveSheet.Shapes("cbReformat").Select
    Selection.Delete
    ActiveSheet.Shapes("cbGenerateIssue").Select
    Selection.Delete
    ' --------> this next line fails (or any variation of it)
    Sheets("1st Issue").Select
    Rows("5:7").Select

    Selecting can be a little problematic. I avoid selecting wherever possible
    so I hope this works...

    HTH


    "mark kubicki" wrote:

    > select method of range class fails (AUGHHH!!!)
    > sheet is unprotected
    > sheet has a control button "cbGenerateIssue"
    > code had been created by recording a macro (where it worked...)
    > select fails even if control button , which calls the code, has not yet been
    > deleted
    >
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Rows("5:7").Select
    >
    >
    >
    > had tried some variations:
    > ...Sheets("1st Issue).Rows("5...
    > ...put the select into a function
    > ... moved the calling control deletion to after select...
    > nothing
    >
    > thanks in advance,
    > mark
    >
    >
    >


  10. #10
    mark kubicki
    Guest

    Re: select method of range class fails


    "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in message
    news:2557E0EB-44FE-49A1-A343-71F63369679E@microsoft.com...
    > Try re-selecting the sheet...
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Sheets("1st Issue").Select
    > Rows("5:7").Select
    >
    > Selecting can be a little problematic. I avoid selecting wherever possible
    > so I hope this works...
    >
    > HTH
    >
    >
    > "mark kubicki" wrote:
    >
    > > select method of range class fails (AUGHHH!!!)
    > > sheet is unprotected
    > > sheet has a control button "cbGenerateIssue"
    > > code had been created by recording a macro (where it worked...)
    > > select fails even if control button , which calls the code, has not yet

    been
    > > deleted
    > >
    > >
    > > Private Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Select
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > Sheets("Issue worksheet (2)").Select
    > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > ActiveSheet.Shapes("cbReformat").Select
    > > Selection.Delete
    > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > Selection.Delete
    > > ' --------> this next line fails (or any variation of it)
    > > Rows("5:7").Select
    > >
    > >
    > >
    > > had tried some variations:
    > > ...Sheets("1st Issue).Rows("5...
    > > ...put the select into a function
    > > ... moved the calling control deletion to after select...
    > > nothing
    > >
    > > thanks in advance,
    > > mark
    > >
    > >
    > >




  11. #11
    Don Guillett
    Guest

    Re: select method of range class fails

    Let's see. There are only 4 selects in your original post. Try my last post.

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    news:e9bnEsqSFHA.2128@TK2MSFTNGP14.phx.gbl...
    >
    > "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in

    message
    > news:2557E0EB-44FE-49A1-A343-71F63369679E@microsoft.com...
    > > Try re-selecting the sheet...
    > >
    > > Private Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Select
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > Sheets("Issue worksheet (2)").Select
    > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > ActiveSheet.Shapes("cbReformat").Select
    > > Selection.Delete
    > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > Selection.Delete
    > > ' --------> this next line fails (or any variation of it)
    > > Sheets("1st Issue").Select
    > > Rows("5:7").Select
    > >
    > > Selecting can be a little problematic. I avoid selecting wherever

    possible
    > > so I hope this works...
    > >
    > > HTH
    > >
    > >
    > > "mark kubicki" wrote:
    > >
    > > > select method of range class fails (AUGHHH!!!)
    > > > sheet is unprotected
    > > > sheet has a control button "cbGenerateIssue"
    > > > code had been created by recording a macro (where it worked...)
    > > > select fails even if control button , which calls the code, has not

    yet
    > been
    > > > deleted
    > > >
    > > >
    > > > Private Sub cbGenerateIssue_Click()
    > > > Sheets("Issue worksheet").Select
    > > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > > Sheets("Issue worksheet (2)").Select
    > > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > > ActiveSheet.Shapes("cbReformat").Select
    > > > Selection.Delete
    > > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > > Selection.Delete
    > > > ' --------> this next line fails (or any variation of it)
    > > > Rows("5:7").Select
    > > >
    > > >
    > > >
    > > > had tried some variations:
    > > > ...Sheets("1st Issue).Rows("5...
    > > > ...put the select into a function
    > > > ... moved the calling control deletion to after select...
    > > > nothing
    > > >
    > > > thanks in advance,
    > > > mark
    > > >
    > > >
    > > >

    >
    >




  12. #12
    mark kubicki
    Guest

    Re: select method of range class fails

    what i'm needing to do is convert the formula result across the sheet to
    values... maybe instead of trying to fix this mess, there's a different
    (more efficient) way??



    "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in message
    news:2557E0EB-44FE-49A1-A343-71F63369679E@microsoft.com...
    > Try re-selecting the sheet...
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Sheets("1st Issue").Select
    > Rows("5:7").Select
    >
    > Selecting can be a little problematic. I avoid selecting wherever possible
    > so I hope this works...
    >
    > HTH
    >
    >
    > "mark kubicki" wrote:
    >
    > > select method of range class fails (AUGHHH!!!)
    > > sheet is unprotected
    > > sheet has a control button "cbGenerateIssue"
    > > code had been created by recording a macro (where it worked...)
    > > select fails even if control button , which calls the code, has not yet

    been
    > > deleted
    > >
    > >
    > > Private Sub cbGenerateIssue_Click()
    > > Sheets("Issue worksheet").Select
    > > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > > Sheets("Issue worksheet (2)").Select
    > > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > > ActiveSheet.Shapes("cbReformat").Select
    > > Selection.Delete
    > > ActiveSheet.Shapes("cbGenerateIssue").Select
    > > Selection.Delete
    > > ' --------> this next line fails (or any variation of it)
    > > Rows("5:7").Select
    > >
    > >
    > >
    > > had tried some variations:
    > > ...Sheets("1st Issue).Rows("5...
    > > ...put the select into a function
    > > ... moved the calling control deletion to after select...
    > > nothing
    > >
    > > thanks in advance,
    > > mark
    > >
    > >
    > >




  13. #13
    Tom Ogilvy
    Guest

    Re: select method of range class fails

    Private Sub cbGenerateIssue_Click()
    Sheets("Issue worksheet").Select
    Sheets("Issue worksheet").Copy Before:=Sheets(1)
    Sheets("Issue worksheet (2)").Select
    Sheets("Issue worksheet (2)").Name = "1st Issue"
    ActiveSheet.Shapes("cbReformat").Select
    Selection.Delete
    ActiveSheet.Shapes("cbGenerateIssue").Select
    Selection.Delete
    ' --------> this next line fails (or any variation of it)
    Activesheet.Rows("5:7").Select

    --
    Regards,
    Tom Ogilvy


    "mark kubicki" <MK@KuglerTillotson.com> wrote in message
    news:eLVnFwpSFHA.1040@TK2MSFTNGP10.phx.gbl...
    > select method of range class fails (AUGHHH!!!)
    > sheet is unprotected
    > sheet has a control button "cbGenerateIssue"
    > code had been created by recording a macro (where it worked...)
    > select fails even if control button , which calls the code, has not yet

    been
    > deleted
    >
    >
    > Private Sub cbGenerateIssue_Click()
    > Sheets("Issue worksheet").Select
    > Sheets("Issue worksheet").Copy Before:=Sheets(1)
    > Sheets("Issue worksheet (2)").Select
    > Sheets("Issue worksheet (2)").Name = "1st Issue"
    > ActiveSheet.Shapes("cbReformat").Select
    > Selection.Delete
    > ActiveSheet.Shapes("cbGenerateIssue").Select
    > Selection.Delete
    > ' --------> this next line fails (or any variation of it)
    > Rows("5:7").Select
    >
    >
    >
    > had tried some variations:
    > ...Sheets("1st Issue).Rows("5...
    > ...put the select into a function
    > ... moved the calling control deletion to after select...
    > nothing
    >
    > thanks in advance,
    > mark
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1