Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Formatting variables

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formatting variables

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



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

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formatting variables

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






  #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









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formatting variables

Works for me. Would help if you explained in what way it is not working,
perhaps the worksheet is protected.

--
HTH

Bob Phillips

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

"Dan" wrote in message
...
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









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

The sheet is not protected. The data is justified left or right, depending on
how excel pasted it.

Also to concatenate the inforamtion worked but need to modify it for
additional information.

I have some cells where there is proceeding "0" and I want to keep this
information. Also when I concatenate to it I get "spaces" between the
information but do not want them.

..Offset(0, 2).Value = Right("0000000" & myID & "h", 4)
Data Want Get
2C0 2C0h 2C0h
402 402h 402h
0 000h 0 h - two spaces between 0 and h
14 0014h 14 h - one space b/w 14 and h
2 0002h 2 h - two spaces between 2 and h

Thanks

"Bob Phillips" wrote:

Works for me. Would help if you explained in what way it is not working,
perhaps the worksheet is protected.

--
HTH

Bob Phillips

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

"Dan" wrote in message
...
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










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting with variables ScoobyDoo Excel Worksheet Functions 1 February 22nd 08 06:00 PM
Formatting Variables imported into Word... ChrisMattock[_22_] Excel Programming 2 May 31st 06 11:52 AM
Conditional formatting for more than 3 variables Emile Excel Worksheet Functions 8 March 7th 06 04:27 PM
formatting variables JT Excel Programming 4 December 22nd 05 04:17 PM
Cell formatting with 2 variables John Hipskind Excel Programming 6 August 4th 03 04:53 PM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"