Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel in visual basic

Status
Not open for further replies.

VBmim

Programmer
Jun 25, 2001
361
BE
I want to set the alignment of some cells to Center from Visual basic.

I want to do something like this

excelObj.activesheet.range("g1:i1").alignment = Center

Does something like that works?

Mim
 
Yes, this is a very basic funtionality. This will do the trick for you:
ActiveSheet.Range("g1:i1").HorizontalAlignment = xlCenter

Steve
 
Instead of .alignment=center you should use
.HorizontalAlignment = xlCenter

gmonk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top