I was wondering if there is a way to test if the first letter in a table cell is capitalized without ripping the letter and comparing it to an array full of CHR codes or looping 26 instr() functions for every cell.
Basically, we have clients that send us tables in which the stub cell (far left) has part of the sentences on one line and then the rest on the line below, indented.
The issue is that I can't use the indents to test for these scenarios because other cells are indented for other reasons. I need to apply row shading depending on these scenarios and I'm having a hard time finding an efficient way to test for this.
This code returns 1
MsgBox (StrComp("This sentence continues", UCase("This sentence continues"), vbBinaryCompare))
This code returns 1 too
MsgBox (StrComp("this sentence continues", UCase("This sentence continues"), vbBinaryCompare))
Assuming you already have the character stored in a string strFirst
:
StrComp(strFirst, UCase(strFirst), vbBinaryCompare)
would return 0 if the letter is uppercase.
If you do not already have the first character from the text then you'll need to extract it using Left(string, 1)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With