If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > How to wrap text from excel spreadsheet by VB.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 2
Red face How to wrap text from excel spreadsheet by VB.

I want to use multiline in spreadsheet but i try Chr(13) + Chr(10) but it not work. Any idea ???
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Feb 2003
Location: Montreal, Canada
Posts: 117
Re: How to wrap text from excel spreadsheet by VB.

Columns("A:A").Select
Selection.ColumnWidth = 30
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True '!!!!!!!!!!!!!!!!!!!!!
.Orientation = 0
End Width

You can find all these by recording a macro directly in Excel (see tools menu)


Quote:
Originally posted by taboty
I want to use multiline in spreadsheet but i try Chr(13) + Chr(10) but it not work. Any idea ???
__________________
Steve
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 2
Re: How to wrap text from excel spreadsheet by VB.

Quote:
Originally posted by dbadelphes
Columns("A:A").Select
Selection.ColumnWidth = 30
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True '!!!!!!!!!!!!!!!!!!!!!
.Orientation = 0
End Width

You can find all these by recording a macro directly in Excel (see tools menu)
Thank you...Steve
But i can't to use it in vb with spreadsheet.
because spreadsheet is not have property "WrapText".
What can i do ??
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Feb 2003
Location: Montreal, Canada
Posts: 117
Re: How to wrap text from excel spreadsheet by VB.

Hi,

First, you must declare a workbook object, something like:
Dim wkbNew as Excel.Workbook
then either you use an existing spreadsheet, either you add a new one:
Set wkbNew = Workbook.Open 'or Set wkbNew = Workbook.Open "YOUREXCELDOC.XLS"
wkbNew.Sheets.Add After:=Worksheets(Worksheets.Count)
wkbNew.Sheets("Sheet1").Select
Range("A1").Select
:
:

Quote:
Originally posted by taboty
Thank you...Steve
But i can't to use it in vb with spreadsheet.
because spreadsheet is not have property "WrapText".
What can i do ??
__________________
Steve
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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