Closed Thread
Results 1 to 2 of 2

[UserForm's Listbox]Why is sheetname empty when using it in another procedure?

  1. #1
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    [UserForm's Listbox]Why is sheetname empty when using it in another procedure?

    Trying to make macro to copy paste data from wb1 to wb2.

    Trying to use shtName selection in the list box to use it in another procedure

    Please Login or Register  to view this content.
    After drilling down, I find shtName variable to be empty.

    Please Login or Register  to view this content.
    Things that I have tried:

    - Putting shtName var in declarations section: Public shtName as worksheet
    - Setting shtName to worksheet object using Set keyword.

    Is there any other listbox method I should be aware of?

    One other question if you could answer:

    • How to avoid standard message that states to clear clipboard (at the end of copyData procedure)? Programmatically.

    Attachment 763944

    ________________________________________________

    For reference, here is the full code:


    Please Login or Register  to view this content.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,288

    Re: [UserForm's Listbox]Why is sheetname empty when using it in another procedure?

    Administrative Note:

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread: https://www.excelforum.com/excel-pro...procedure.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [UserForm's Listbox]Why is sheetname empty when using it in another procedure?
    By immigrated4urjob in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-18-2022, 08:03 AM
  2. [SOLVED] Userform Can't Open When ListBox is Empty
    By Matt W in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 09-14-2021, 12:39 PM
  3. userform listbox add empty cell to my list
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2020, 06:12 PM
  4. [SOLVED] Selecting SheetName from Listbox
    By n4rs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2019, 11:26 PM
  5. Unable to get userform listbox items into next empty cell
    By neevee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2018, 02:18 PM
  6. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  7. Use sheetname to open a Userform
    By aph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2007, 03:19 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