+ Reply to Thread
Results 1 to 2 of 2

vba Code after vbModeless doesn't work

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    23

    vba Code after vbModeless doesn't work

    Hi Everyone,

    I have a code that supposed to run after vbModeless but unfortunately it doesn't. It should display the listbox content where i could choose from the list. Listbox content will only displays the content once listbox is clicked.
    I hope you code help me on this. Below is my code for your reference.

    #Sub sample()
    Application.ScreenUpdating = False
    If Range("s1") = 0 Then
    MsgBox "There items saved in this file"
    End
    End If

    Application.ScreenUpdating = False


    CURRENTSHEET = ActiveSheet.Name

    'Sheets("3").Visible = True
    'Sheets("raw data 2").Visible = True
    Sheets("3").Range("A2:AAA1000").ClearContents



    Sheets("raw data 2").Range("xfd1001") = CURRENTSHEET

    Sheets(CURRENTSHEET).Select


    userform1.StartUpPosition = 0
    userform1.Top = Application.Top + 25
    userform1.Left = Application.Left + Application.Width - userform1.Width - 25

    userform1.Show vbModeless

    End Sub#

    This is my code that supposed to run after vbmodeless

    #Private Sub ListBox1_Enter()

    Application.ScreenUpdating = False


    ListBox1.Clear

    Sheets("raw data 2").Range("FA1:xfd1000").ClearContents


    With ListBox1
    .AddItem Sheets("Raw data1").Range("B2")
    .AddItem Sheets("Raw data1").Range("B3")
    .AddItem Sheets("Raw data1").Range("B4")
    .AddItem Sheets("Raw data1").Range("B5")
    End with

    End sub
    #

    Thank you.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: vba Code after vbModeless doesn't work

    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 6)

+ 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. Please help: why my code doesn't work?
    By zhang1d in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2017, 11:32 PM
  2. Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.
    By MayDay1988 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2017, 06:14 PM
  3. [SOLVED] Why DOESN'T this Sort Code work?
    By CaptMac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2016, 02:42 PM
  4. [SOLVED] Need help with VBA code. Tons of code seperated in two, second part of code doesn't work.
    By FragaGeddon in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-30-2015, 11:46 AM
  5. How does the "vbModeless" in "UserForm.show vbModeless" work?
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-13-2013, 07:43 PM
  6. [SOLVED] Why doesn't ths VBA Code work?
    By Mac Lingo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2005, 10:10 PM
  7. vba code doesn't work
    By lschuh in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-22-2005, 02:05 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