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: 10
Default Some Help Please to Translate an Excel Macro into VB.Net Code

I am building an Excel spreadsheet using VB.Net code. I want the vertical
alignment for all cells to be "Top". To know what code I'd need I turned on
macro recording and went through the manual process. I got the following
result ...

Cells.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

I only care about the vertical alignment, so I am not trying to do any of
the other stuff in VB.Net. Instead of the Cells.Select I found that in my
code I'd need "objSheet.Cells.Select()" - that compiles and builds without
error. It's the vertical alignment line that is causing me problems.
"objSheet.Selection.VerticalAlighment = objApp.xltop" does not work because
Selection is not a member of Excel._Worksheet and
"objSheet.VerticalAlighment = objApp.xltop" does not work because
verticalalignment is not a member of Excel._Worksheet.

I'll appreciate any help anyone can offer. Thanks, Bob


 
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
Could someone HELP TRANSLATE this simple psuedo code into MACRO pl bxc2739[_3_] Excel Programming 1 April 27th 06 07:46 PM
Could someone HELP TRANSLATE this simple psuedo code into MACRO please?! bxc2739 Excel Discussion (Misc queries) 3 April 27th 06 06:53 PM
translate ws formula to vba code L Scholes Excel Programming 2 April 17th 06 03:34 AM
Macro translate from number to text thanhnguyen[_14_] Excel Programming 1 March 27th 06 05:43 AM
translate lotus 1-2-3 macro into excel macro using excel 2000 krutledge0209 Excel Programming 1 November 2nd 04 05:50 PM


All times are GMT +1. The time now is 10:32 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"