In Excel Click check box = auto change row
Once an okay VB.NET user, now forgot everything about it! I think this is probably pretty easy but I can't remember where to begin. HELP!!!
I have a very basic worksheet in Excel. When the user clicks a check box, I want the corresponding row to automatically change color. And, if possible, I would like the row to become protected when the check box is checked. Any help would be great!
Re: In Excel Click check box = auto change row
Welcome to the Forums.
Easiest way to learn most objects in Office VBA is to record a macro doing the task you want to program. Then look at the generated code to see what objects are used and how. Then you can tweek it how you may need. ;)
Re: In Excel Click check box = auto change row
That was a wuss out if I ever saw one... :D
Recorded macros over bloat the code.. this can actually be done in one line.. but I'll show the possibilities
VB Code:
ActiveCell.EntireRow.Interior.Color = vbBlue
Range("A1").EntireRow.Interior.Color = vbBlue
Range("D5").EntireRow.Interior.Color = RGB(0,0,255)
All set the either the last selected cell or a direct range to blue interior
Re: In Excel Click check box = auto change row
Perhaps you need to read the entire post before you reply. ;)
Quote:
Originally Posted by RobDog888
...Then look at the generated code to see what objects are used and how. Then you can tweek it how you may need.
I mentioned it as a way to learn what objects to use so you can write it yourself.
Give a programmer code and hes employed for a day. Teach a programmer how to program and you have helped him to become employed for a lifetime. ;)
Re: In Excel Click check box = auto change row
Quote:
Originally Posted by RobDog888
Give a programmer code and hes employed for a day. Teach a programmer how to program and you have helped him to become employed for a lifetime.
Totally agree with your there.. :D