Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default EXCEL AND VBA

Hi all.
I use VB6 to generate an Excel report.
I have 3 questions:

1. If .NumberFormat ="@" is for text , what is the NumberFormat for
numerical values? (Integer values).

2. How do I make A1:E1 cells to be centered ? (without causing the whole
column to be centered).

3. How do I put text that contains vbCr (return) in a cell ?

e.g.
First Last Phone
Name Name Number


TIA
Guy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default EXCEL AND VBA

Cloe wrote:
Hi all.
I use VB6 to generate an Excel report.
I have 3 questions:

1. If .NumberFormat ="@" is for text , what is the NumberFormat for
numerical values? (Integer values).

2. How do I make A1:E1 cells to be centered ? (without causing the
whole column to be centered).

3. How do I put text that contains vbCr (return) in a cell ?

e.g.
First Last Phone
Name Name Number

Hi,

These should give you a start. Note that if you're using automation you'll
have to make the object references to the range objects much more explicit -
objXL.workbooks("Book.xls").worksheets("Sheet1").R ange("A1") where objXL is
your Excel application object for example.

Range("E2").NumberFormat = "0"

Range("A1:E1").HorizontalAlignment = Excel.xlCenter

With Range("E1")
.FormulaR1C1 = "Wrapped" & VBA.vbLf & "Text"
.WrapText = True
End With

HTH

Rob


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default EXCEL AND VBA

Thank you Robert.

Something I learnd today :
I recorded a macro "centering a cell" and then looked into the macro code
and could find the VBA code myself :)

Guy


"Robert Bruce" <rob@analytical-dynamicsdotcodotukay wrote in message
...
Cloe wrote:
Hi all.
I use VB6 to generate an Excel report.
I have 3 questions:

1. If .NumberFormat ="@" is for text , what is the NumberFormat for
numerical values? (Integer values).

2. How do I make A1:E1 cells to be centered ? (without causing the
whole column to be centered).

3. How do I put text that contains vbCr (return) in a cell ?

e.g.
First Last Phone
Name Name Number

Hi,

These should give you a start. Note that if you're using automation you'll
have to make the object references to the range objects much more
explicit -
objXL.workbooks("Book.xls").worksheets("Sheet1").R ange("A1") where objXL
is
your Excel application object for example.

Range("E2").NumberFormat = "0"

Range("A1:E1").HorizontalAlignment = Excel.xlCenter

With Range("E1")
.FormulaR1C1 = "Wrapped" & VBA.vbLf & "Text"
.WrapText = True
End With

HTH

Rob




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



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

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

About Us

"It's about Microsoft Excel"