+ Reply to Thread
Results 1 to 8 of 8

changed code but ".select" does not work

  1. #1
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    changed code but ".select" does not work

    hi,

    change my code from this
    (same code for 2nd week to 4th week sheets)
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    it errors on the pname.select

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: changed code but ".select" does not work

    If the range PNAME is not on the currently active sheet, it will throw an error. So all you need is to first activate the relevant Sheet and then select PNAME.

    Add WS.Activate before PNAME.Select.

    BTW what is the use of selecting PNAME?

    You may use the following line to get the details of PNAME on immediate window.

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: changed code but ".select" does not work

    PNAME.Select is so it will scroll to the found name

    edited code now have error in the for each
    Please Login or Register  to view this content.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: changed code but ".select" does not work

    It should be For Each WS In MONTH.Sheets

  5. #5
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: changed code but ".select" does not work

    the error is now back to PNAME.Select

    Please Login or Register  to view this content.

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: changed code but ".select" does not work

    Change this line...

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: changed code but ".select" does not work

    working now, thanks!

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: changed code but ".select" does not work

    You're welcome!

+ 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. Replies: 3
    Last Post: 01-02-2014, 02:15 PM
  2. [SOLVED] strange problem: dot "." changed to coma "," but it schuldnt have been
    By kmeld in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2013, 04:00 AM
  3. Range("A1").select doesn't work!
    By pianoman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2006, 09:08 AM
  4. If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM
  5. [SOLVED] Why doesn't 'Range("A65000").Select' work?
    By Alan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2006, 08:20 PM
  6. Replies: 1
    Last Post: 01-13-2006, 05:09 PM
  7. Excel macro convert to VBA - doesn't work, hangs on Range("Q35").Select
    By Harold Good in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2006, 04:55 PM

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