|
-
Aug 11th, 2005, 11:29 AM
#1
Thread Starter
New Member
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!
-
Aug 11th, 2005, 11:35 AM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 02:01 PM
#3
Re: In Excel Click check box = auto change row
That was a wuss out if I ever saw one... 
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
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Aug 11th, 2005, 02:10 PM
#4
Re: In Excel Click check box = auto change row
Perhaps you need to read the entire post before you reply. 
 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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 02:24 PM
#5
Re: In Excel Click check box = auto change row
 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..
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|