View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Formatting variables

Didn't work.

with destcell
..HorizontalAlignment = xlcenter
..value = myname
..offset(0,1).value = myaddress
..offset(0,2).value = myphone
..offset(0,3).value = mySSN
end with



"Bob Phillips" wrote:

I assumed that you would want it within the

With destcell

End With

block.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Where do I add the statement for ..HorizontalAlignment = xlcenter. I was
aware of the statement but do not know where to place it for each

response.

Thanks

"Bob Phillips" wrote:

Just use

..HorizontalAlignment = xlcenter

to centre the data

Concaten ate the area code with something like

..Offset(0,2).value = "(" & myAreaCode & ") " & myPhone

Test within list, put the private numbers in a list and use

If Not Iserror(Application.Match(myPhone, aryPrivates,0)) Then
.Offset(0,2).Value = "Private"
End If

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Trying to format data prior to inserting into a file:

Open myFileName For Input As FileNum
Do While Not EOF(FileNum)
set destcell=destcell.offset(1,0)
myName = trim(mid(result,1,12))
myaddress = trim(mid(resultstr,13,22))
myphone = trim(mid(resultstr,....
with destcell
.value = myname
.offset(0,1).value = myaddress
.offset(0,2).value = myphone
.offset(0,3).value = mySSN
end with
loop

1. Want to center the data in the cell and also modify it.
2. Want to Concatenate myphone with an area code.
3. Potentially run additional macros against the data, .i.e. if the

phone
number is part of a restriced list then do not display it and show
"Private"
etc.

Thanks