+ Reply to Thread
Results 1 to 5 of 5

Question about Select Case

  1. #1
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Question about Select Case

    Hi,

    Im using this script:

    Please Login or Register  to view this content.
    This is only Level 200 but i have some more levels in this script.
    I want the script to unhide a sheet (which in this case is also called "Level 200"), copy a range and paste it back in the first sheet.
    However it copies the range in the first sheet. So it copies Sheet1 Range(Range("B200").End(xlUp), "H2").Select.

    Can anyone see if there is something wrong with this script?

    Thanks!
    Last edited by Crispy85; 04-05-2016 at 08:27 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about Select Case

    You don't appear to be copying anywhere in the posted code.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Question about Select Case

    You're right!
    I changed the original post.
    I had Copy changed with Select to see if it correctly selects the range but it selects the range in Sheet1.

    So, why doesn't it select the range in sheet Level 200?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about Select Case

    Whenever you are working with code in a worksheet module that refers to other worksheets you should explicitly refer to the other worksheets in the code, don't rely on using ActiveSheet/Select/Selection etc.

    I couldn't quite follow all the posted code, not sure where you are deleting cells from, but try this.
    Please Login or Register  to view this content.
    Note, I've commented out the parts of code showing/hiding the sheet as you shouldn't need a sheet to be visible to copy from it.

  5. #5
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Question about Select Case

    Yes thanks Norie!
    This works.

    I put the visible = true before the With so that works now.
    Thanks for your clarification

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ComboBox Select Case Question
    By yoko21 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2013, 06:49 AM
  2. [SOLVED] Quick question regarding select case
    By thesteve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 09:54 AM
  3. [SOLVED] Select Case and math question
    By kelwood in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2012, 02:07 PM
  4. Select Case Question
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2009, 10:18 AM
  5. Select Case Question
    By extrapulp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-14-2009, 02:01 PM
  6. select case question
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2006, 07:45 PM
  7. VBA select case question
    By Jeff in forum Excel General
    Replies: 2
    Last Post: 01-26-2006, 11:10 PM
  8. [SOLVED] Select Case Question
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-06-2006, 05:40 AM

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