ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA User Form - button problem (https://www.excelbanter.com/excel-programming/301320-excel-vba-user-form-button-problem.html)

weakissues

Excel VBA User Form - button problem
 
How can I create a command button that when pressed adds text or a valu
into a worksheet cell, but skips full cells until it gets to the nex
empty one to put it in. I am creating an EPOS system and a listbox o
the form will display a specific cell range, but i want the button t
add say SOUP if soup is clicked, but then is MUSHROOMS is clicked, i
adds it to the next cell down (skipping the cell which will have SOU
in it). Please help, this has been driving me crazy all week, i can
think how to do it at all. Thanks a lot. Cu

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Excel VBA User Form - button problem
 
Private Sub CommandButton1_Click()
do while activeCell.Value < ""
ActiveCell.Offset(1,0).Select
Loop
ActiveCell.Value = me.Listbox1.Value
End Sub

--
Regards,
Tom Ogilvy



"weakissues " wrote in message
...
How can I create a command button that when pressed adds text or a value
into a worksheet cell, but skips full cells until it gets to the next
empty one to put it in. I am creating an EPOS system and a listbox on
the form will display a specific cell range, but i want the button to
add say SOUP if soup is clicked, but then is MUSHROOMS is clicked, it
adds it to the next cell down (skipping the cell which will have SOUP
in it). Please help, this has been driving me crazy all week, i cant
think how to do it at all. Thanks a lot. Cuz


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com