473,396 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

text justification in excel

I am creating an excel spreadsheet from vb.net 2005. I followed the
advice of some other posts on how to "Center Text in Excel" by creating
a macro in excel to do what I want and then looking at the code.

"oSheet.Range("F3").HorizontalAlignment = xlRight" is what was posted
there. When I try this, I get an error of "xlRight is not declared"

What do I declare it as?

Thanks

Jul 12 '06 #1
3 3597
krollenhagen wrote:
I am creating an excel spreadsheet from vb.net 2005. I followed the
advice of some other posts on how to "Center Text in Excel" by creating
a macro in excel to do what I want and then looking at the code.

"oSheet.Range("F3").HorizontalAlignment = xlRight" is what was posted
there. When I try this, I get an error of "xlRight is not declared"

What do I declare it as?

Thanks
Look at what type of object HorizonatlAligment expects. It will be
something system.something.horizontalAligment.xlright
chris
Jul 12 '06 #2
It works as an integer. Center is 3, Right is 4

Thanks.

Chris wrote:
krollenhagen wrote:
I am creating an excel spreadsheet from vb.net 2005. I followed the
advice of some other posts on how to "Center Text in Excel" by creating
a macro in excel to do what I want and then looking at the code.

"oSheet.Range("F3").HorizontalAlignment = xlRight" is what was posted
there. When I try this, I get an error of "xlRight is not declared"

What do I declare it as?

Thanks

Look at what type of object HorizonatlAligment expects. It will be
something system.something.horizontalAligment.xlright
chris
Jul 12 '06 #3
Is there a way to get vb to recognize the xlLeft, xlRight, xlCenter,
etc.. names instead of having to figure out what the corresponding
integer is?

I am having trouble getting the borders to work properly. There are a
lot more options than left, center and right in the borders to guess
which integer corresponds to a given style, color, weight, etc...

Thank you,

Jul 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Owen Jacobson | last post by:
We all know that text-align: justify; is supposed to justify the block's text across the box. I have a friend, however, who wants to take that further. A visual example, because it's 2:30 AM and...
2
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to input data from strings to a memo field. I would like to know how to check first to see if there is text there currently and if so...
1
by: Alex | last post by:
The JustiDirect text justification on Stephen LeBans site works well but I cannot get it to work on a sub report. Could anyone tell me if this is possible. Thanks. Alex
1
by: AMD 3400 | last post by:
Hello there, i have a question to ask, i have a huge 5000 columns in Excel that i've been working on and i want it right-justified. When i open it in Access it gives me left-justified. i would...
4
by: devine | last post by:
Hi All, I am VERY new to Javascript. I have been provided with some code, which will enable me to hide/show a text area and change a submit button dependant on a check box. <!DOCTYPE html...
29
by: Michael Bulatovich | last post by:
Is there a way to use CSS to format "plain" text in an html document. By plain I mean text which is not contained by <por <h#tags. Is there no way to control how this stuff is rendered? tia
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
10
by: gaetanoortisi | last post by:
Hello, can anyone point me to some piece of code that do text justification of fixed fonts like those that nroff do on manpages? Thanks, Gaetano
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.