dot - what before?

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,072
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Often googling for a solution show things like
Code:
.ForeColor.RGB = RGB( _
                     Sheets(1).Cells(4, 4), _
                     Sheets(1).Cells(4, 5), _
                     Sheets(1).Cells(4, 6) _
                     )

How do you find or work out what goes before the "." ?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Look for a line that says 'With variableName'. That variable is what goes before the ".".
 
Upvote 0
Yes, but if that's missing? I mean where can one look for ".Forecolor" to find what can come before it?
I know there's millions of them but are they documented anywhere?
 
Upvote 0
Forecolor probably refers to a textbox on a userform, and it's using the rgb values from the sheet cells to set the color.
 
Upvote 0
If you go into the VBA editor, hit F2, and search for forecolor, you will see all the things that can come before .forecolor.
 
Upvote 0
If there's no With then the code won't compile, you'll get an 'Invalid or unqualified reference' error.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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