+ Reply to Thread
Results 1 to 6 of 6

Select all not working while selecting All Sheets using excel VBS

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    India, Gujarat
    MS-Off Ver
    2013
    Posts
    2

    Exclamation Select all not working while selecting All Sheets using excel VBS

    I m creating a VBS that converts all the excel formulas into values
    (i.e. Select All Sheets>> Select All Cells >> Copy>> Paste Special>> Values//Using VBS)

    I am almost close to it but there is some issue with my code may be.



    Please Login or Register  to view this content.
    Everything is working fine but the issue is Select all cells is not working properly.

    This command is selecting All cells depending on the content in the first sheet.

    For example if there is data in Sheet1 from A1 to B7 ten all the other sheets will be getting effect in cells A1 to B7

    Actually select all code(i.e objWorkbook.ActiveSheet.Cells.Select) should Select All "A" to "XFD" Columns

    but it is not working.

    Kindly help me to solve this issue.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Select all not working while selecting All Sheets using excel VBS

    I'm pretty sure you'd have to loop through and do each sheet at a time... selecting all sheets the way you are still leaves only 1 sheet as "activesheet"

    Alternatively, copy a large range that guarantees all data is copied... rather than "usedrange")
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Select all not working while selecting All Sheets using excel VBS

    Hi,

    Don't use this
    Please Login or Register  to view this content.
    Use this
    Please Login or Register  to view this content.
    Lokesh Kumar
    Stay Hungry.. Stay Foolish..
    _________________________________________________________
    Please Click STAR to Add Reputation if my/someone's answer helped!

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Select all not working while selecting All Sheets using excel VBS

    Hi,

    You need to loop through all sheets. e.g.
    Please Login or Register  to view this content.
    However be careful if any sheets have hidden rows or columns. Pasting doesn't work unless you first unhide everything.

    As a general principle avoid selecting or activating stuff: it's rarely necessary.
    Last edited by Richard Buttrey; 04-29-2016 at 08:30 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    04-29-2016
    Location
    India, Gujarat
    MS-Off Ver
    2013
    Posts
    2

    Re: Select all not working while selecting All Sheets using excel VBS

    Quote Originally Posted by LokeshKumar View Post
    Hi,

    Don't use this
    Please Login or Register  to view this content.
    Use this
    Please Login or Register  to view this content.
    Hay... Its Working.....
    Thank you so much

  6. #6
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Select all not working while selecting All Sheets using excel VBS

    Please mark this thread as solved.

+ 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] Sheets("Sheet Name").select (not working)
    By Andrew Andromeda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2015, 01:28 PM
  2. .Select selecting multiple sheets in a form
    By Kris_cs1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-20-2014, 12:47 AM
  3. Selecting all cells. Cells.Select is not working
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2013, 04:50 PM
  4. Selecting all cells. Cells.Select is not working
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2013, 04:04 PM
  5. Excel 2007 - Moving to/ selecting next cell in filtered sheet is not working.
    By MarMo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2012, 03:53 AM
  6. SQL select for selecting data from Access and Excel together
    By johnjohns in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2011, 01:59 AM
  7. Replies: 1
    Last Post: 10-29-2009, 08:23 PM

Tags for this Thread

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