long text string

  • Thread starter Thread starter jhahes
  • Start date Start date
J

jhahes

Could someone please help me with this..

I am trying to write a simple telephone script....I would use word, bu
the script will eventually reference formulas...so i thought excel woul
work.....

This is what I have....The problem I am having is that I am trying t
go to the next line so I can see everything and it is givin
errors....i am using the blank space and the _ to go to the next lin
and it won't work....Does VBA have word wrap?.....

Dim introScript as string
Dim clientFirstName as string
Dim additionalCash as currency

clientFirstName = frmStep3.txtFirstName.value
additionCash = frmStep3.txtAdditionalCash.value

introScript = "Hi " & clientFirstName & " this is Josh from ABC Co
how are you? Based on your information, you are requesting "
additionalCash & " is this correct?"


......The script is much longer....is there anyway to put this so i
can be on multipe lines in the VBA editor...when i use the blank spac
and _ character is gives me errors....Also, does anyone know if ther
are any templates for telephone scripts?....

...thanks for any help

Jos
 
Why dont you store/edit/maintain the strings in Excel cells,
and have your code read them from there?

insert "placeholders" for your variables..


For each rngRow in rngClientTable.Rows

s= Range("introscript").Value
s= replace (s,"%clientfirstname%", txtFirstName.Text)
s= replace (s,"%additionalcash%", txtAdditionalCash.Text)

instroscript=s

Capisce?

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


jhahes wrote in
 
introScript = "Hi " & clientFirstName & " this is Josh from ABC Co, " & _
"how are you? " & vbNewLine & _
"Based on your information, you are requesting " & _
additionalCash & ". Is this correct?"

demo'd from the immediate window:

clientFirstName = "Jim Bob"
additionalCash = "$1,000,000"
introScript = "Hi " & clientFirstName & " this is Josh from ABC Co, " & _
"how are you? " & vbNewLine & _
"Based on your information, you are requesting " & _
additionalCash & ". Is this correct?"
? introScript
Hi Jim Bob this is Josh from ABC Co, how are you?
Based on your information, you are requesting $1,000,000. Is this correct?
 

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

Back
Top