identifying the character represented by a square box

B

broro183

Hi all

How can I identify the character code for a square box into the
following line of code?

Range("D3:D" & LastRow).value = "=IF(LEN(A3)=0,IF(LEFT(A4,1)=" ","Keep
as divider","DELETE"),IF(LEFT(A3,10)="principal:","Start of
message","Contains info"))"

Currently this line results in the VBE error "invalid character" & I am
hoping to incorporate it into the string by using something like its
character code. Is this possible?

background info:
This is part of a larger collection of macros that work together to
allow me to filter & search historical emails (in a text file) after my
company swaps from Lotus Notes to Outlook. I hope to be able to provide
this to work colleagues for their use as well.
Column A contains the text from the messages & the character visually
represented by the square box appears to be the divider between email
trails & so I have offset it by one row eg "A4" cf "A3".

This box would not copy into a formula, but was able to copy it into a
cell & build the formula around it.

Any suggestions are greatly appreciated,

Rob Brockett
NZ
Always learning & the best way to learn is to experience...
 
M

MattShoreson

I believe, and I may be wrong here, but the box represents some sort o
carriage return/enter type key stroke.

You can emulate this in vb by using using the intrinsic constan
'vbcrlf'.

Apologies if this isnt what you need, I didnt read the whole post
 
B

broro183

Hi Matt,
Thanks for your suggestion, but it appears I posted too soon!
I just needed to sit back & look at the line of code to solve my
problem - it lay in my use of single sets of apostrophes in my string
rather than double sets, ie compare the dud code:

Range("D3:D" & LastRow).value = "=IF(LEN(A3)=0,IF(LEFT(A4,1)=" ","Keep
as divider","DELETE"),IF(LEFT(A3,10)="principal:","St art of
message","Contains info"))"

with working code:

Range("D3:D" & LastRow).Value =
"=IF(LEN(A3)=0,IF(LEFT(A4,1)="" "",""Keep as
divider"",""DELETE""),IF(LEFT(A3,10)=""principal:"",""Start of
message"",""Contains info""))"

Once again, thanks for the prompt response,

Rob Brockett
NZ
Always learning & the best way to learn is to experience...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top