|
-
Aug 11th, 2011, 10:41 AM
#1
Thread Starter
Hyperactive Member
worksheet_change event to replace words
i have a worksheet that will continuously be populated with the Words "TRUE" & "FALSE", i need a change event to find these words each time the entered and just replace them
So range is A1:R65536, "TRUE" would be changed to "YES" and "FALSE" would be changed to a blank cell.
-
Aug 11th, 2011, 11:26 AM
#2
Re: worksheet_change event to replace words
I would not want to scan the entire column upon the change event. I would evaluate the Target passed in parameter object to determine if its the desired column and if so then I would do a replace on the active cell.
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, 2011, 11:39 AM
#3
Thread Starter
Hyperactive Member
Re: worksheet_change event to replace words
Ok so its a checkbox from a userform if the value is set true i want it to say yes unless if the value is set as false i dont want it to store a value.
-
Aug 12th, 2011, 04:45 AM
#4
Re: worksheet_change event to replace words
better u fill as "yes" instead of "true" to avoid changing after fill, how do u fill the cells from userform?
-
Aug 12th, 2011, 06:30 AM
#5
Thread Starter
Hyperactive Member
Re: worksheet_change event to replace words
Simple command line :
vb Code:
Sheets(3).range(nrow, lrow + 0).value = checkbox1.value
But this just places the value true or false in the cell.
-
Aug 12th, 2011, 06:39 AM
#6
Re: worksheet_change event to replace words
just use a if statement
Code:
If checkbox1.value = True then
Sheets(3).range(nrow, lrow + 0) = "Yes"
End If
-
Aug 12th, 2011, 06:53 AM
#7
Thread Starter
Hyperactive Member
Re: worksheet_change event to replace words
Thank you bud, ill give it a whirl when i get home
-
Aug 12th, 2011, 07:04 AM
#8
Re: worksheet_change event to replace words
what is the use of adding 0 here?
Code:
Sheets(3).range(nrow, lrow + 0).value = checkbox1.value
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
|