LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Setting HorizontalAlignment with VBA

Hello,

I encounter a problem, when setting the
HorizontalAlignment of a range. Excel changes the
alignment of all cells and not only the cells in the
range. Here ist the code I use:

Dim doc As Excel.Application
Dim wrkbk As Excel.Workbook
Dim wrksh As Excel.Worksheet
Dim range As Excel.Range
Dim style As Excel.Style

doc = CreateObject("Excel.Application")
doc.Visible = True
wrkbk = doc.Workbooks.Add()
wrksh = wrkbk.Worksheets(1)
range = wrksh.Range("A1")
style = range.Style
style.HorizontalAlignment = Excel.Constants.xlCenter

Could anybody help me? Thank's
Jo
 
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
setting default filter setting tpeter Charts and Charting in Excel 0 December 4th 09 02:50 PM
setting up networkdays mp Excel Worksheet Functions 3 May 6th 09 04:26 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
VBA Setting .Value to a date does not respect local system setting Frank_Hamersley Excel Programming 13 July 18th 04 02:51 PM
Sending email via macro- setting the importance setting. Julian Milano[_2_] Excel Programming 1 January 20th 04 10:15 PM


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

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"