Vba userform issues with black cells

Kargg0

New Member
Joined
Jan 3, 2018
Messages
2
I don’t see any posting on this issue anywhere!
i have a .xlsx that has two user forms- 1 is to enter new data which can be recorded to a worksheet and the 2nd is to source the worksheet and edit a particular row of selected data-
My company uses win7. The problem I am having is as follows- when me or my boss open up the tool and test it works awesome!; but I had two other future users open up the edit userform to test and when they select and bring in a row of data to edit, all the data comes in but for some reason text boxes and list boxes in the first tab are black. I checked my properties and my code and nothing is showing a problem- the background is set to white in properties!...is there some advanced property that I am missing that users would need to fix on their local box? Or is there another issue I am overlooking?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I have not heard of this but as a quick fix you could set the colour of your fields when the form loads?

Below is my test script I have taken from one of my files and put against a basic userform with a textbox, a combobox and a list box - changed the colour to light blue background and blue text:

Code:
Private Sub UserForm_Initialize()
On Error Resume Next
Dim ctl2 As Control
For Each ctl2 In UserForm1.Controls
            If TypeName(ctl2) = "ComboBox" Or TypeName(ctl2) = "TextBox" _
            Or TypeName(ctl2) = "ListBox" Then
         
                ctl2.BackColor = RGB(155, 233, 247)  ' light blue
                'ctl2.BackColor = vbWhite
                ctl2.ForeColor = vbBlue
                'ctl2.ForeColor = vbBlack
                ctl2.Font.Bold = False
            End If
                Next ctl2

End Sub
 
Upvote 0
Thanks for the code.. I will use in future since it was a desire to change some colors of certain fields. I was perturbed about this issue so I went in and just removed the boxes and put in new ones with the same names and the user said it resolved issue.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top