im trying to get a message to pop up when commandbutton2 is pressed and there is nothing in listbox1 that says "view data first".. please help
im trying to get a message to pop up when commandbutton2 is pressed and there is nothing in listbox1 that says "view data first".. please help
I am guessing that command button is embed in worksheet. If it is so, then enable design mode under developer tab and then right click on button,
Click on viewcode and enter the following between private sub and end sub:
Please Login or Register to view this content.
Last edited by alansidman; 02-28-2015 at 08:19 PM.
MDembla
Code Tags Added
Your post does not comply with Rule 3 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.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html
(Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
The listbox is in userform1 and the command button is in the form
any ideas on how to get this to work in userform?
Right click on the command button in userform, click view code and enter this between private sub and end sub:
Please Login or Register to view this content.
Last edited by MDembla; 02-28-2015 at 10:12 PM.
I tried that.. but it did not do anything.. I have data that is populated into the list box and I want it to check and see if any data is in the listbox when the command button is pressed. if ther isn't id like a message to pop up... heres the code I have so far
Please Login or Register to view this content.
Can you upload the workbook?
here it is
I am stuck at "File not found" as you have defined a function to get data from a txt file located at your desktop. It will be good if you can upload that as well.
sorry heres one of the files. if you type in 127195 in the text box and click get data this file should show up in list box.
that is in a folder want me to upload the folder?
no this will do. Thanks.
okay... so if you notice when you first open and you type that number in you can click save data and it will save it without it even coming up in the list box.. so that's why I want a message that says get data first so it will show up in the listbox
I guess this is what you wanted. Check it and let me know if it is working as per your requirements.
I guess i have mistakenly deleted the headings in the worksheet. Apologies for that.
almost!! this is seeing if the textbox is empty.. im worried about the listbox... if the listbox is empty I want the message to come up thank you
Working on it
thank you! your a big help
Hello mate, I have made some changes and now it should work. Check it and let me know. I have added message box which will appear if part number is not entered.
Last edited by MDembla; 03-01-2015 at 02:27 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks