ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Clear Screen (https://www.excelbanter.com/excel-programming/416316-vba-clear-screen.html)

Doobage20

VBA Clear Screen
 
I am trying on a VBA form to clear the screen leaving blank variables. The
screen does clear fine. The problem I am running into is that one of the
fields being cleared is the product list selection. After the clear screen,
the product list add the list of products to the existing list so the
products are now displayed twice. Clear the screen again and the product
list is displayed three times. Any ideas on why this is happening.

Private Sub ClearButton1_Click()
Prqty.Text = ""
PrComboBox.Value = "Select a Product"
PrMSRP.Text = ""
Prwholesale.Text = ""
Pronline.Text = ""
End Sub

Doobage



Rick Rothstein

VBA Clear Screen
 
A ListBox is not cleared by clearing its Text property... it has a Clear
method which you should use to clear the items from the list...

YourListBoxName.Clear

--
Rick (MVP - Excel)


"Doobage20" wrote in message
...
I am trying on a VBA form to clear the screen leaving blank variables. The
screen does clear fine. The problem I am running into is that one of the
fields being cleared is the product list selection. After the clear
screen,
the product list add the list of products to the existing list so the
products are now displayed twice. Clear the screen again and the product
list is displayed three times. Any ideas on why this is happening.

Private Sub ClearButton1_Click()
Prqty.Text = ""
PrComboBox.Value = "Select a Product"
PrMSRP.Text = ""
Prwholesale.Text = ""
Pronline.Text = ""
End Sub

Doobage





All times are GMT +1. The time now is 11:40 PM.

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