|
|
#1 |
|
New Member
Join Date: Dec 05
Posts: 2
![]() |
Excel macro problem (Simple?)
I'm a newbie to macro editing (though I do know basic VB) and am trying to create a macro which takes each cell in row B in a sheet from row 26 to 11230 and test if there are less than two spaces in the text of that cell (less than three words). If there's only one or zero spaces, the cell should be made invisible by making the text color white. Also, if the cell contains either "/" or "," or "&" somewhere in the text, the cell should NOT be whited out, even though there's less than three words. Finally, some cells may contain a space in the end of the text, why that last character is best not checked at all (the important thing is that no unsure cells are whited out). The main problem is how I convert numbers and strings into the irritating type Range, which is how I try to check all cells from X to Y. Here's my failing code, beware of stupid variable names...
VB Code:
Variable declarations: VB Code:
Thanks for your help!
|
|
|
|
|
|
#2 |
|
Fanatic Member
Join Date: Nov 04
Location: Lincoln, NE
Posts: 826
![]() ![]() |
Re: Excel macro problem (Simple?)
Try this:
VB Code:
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Dec 05
Posts: 2
![]() |
Re: Excel macro problem (Simple?)
Thanks! Though the macro was supposed to white out cells with less than two spaces I easily fixed it so it works perfectly. I shall learn more about macro writing when I have time. Thanks again
!
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|