JohnOne Posted February 24, 2015 Share Posted February 24, 2015 (edited) I have a couple of columns where the data in them is left justified. The column to it's left is right justified and it looks crappy. How to get those columns to right justify. I tried 2 ways below which were unsuccessful. $oAppl.ActiveSheet.Columns("G:H").HorizontalAlignment = $oAppl.HorizontalAlignment.xlRight $oAppl.ActiveSheet.Columns("G:H").HorizontalAlignment.xlRight Edited February 25, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted February 24, 2015 Author Share Posted February 24, 2015 Got it. $oAppl.ActiveSheet.Columns("G:H").HorizontalAlignment = -4152 I had searched way before posting question, sorry if wasted anyone's time. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution water Posted February 24, 2015 Solution Share Posted February 24, 2015 (edited) When you are talking about columns, rows or cells the starting point is the Ranges object in MSDN (Excel 2010). The list of enumerations starts here (Excel 2010). In your case use: Global Const $xlRight = -4152 $oAppl.ActiveSheet.Columns("G:H").HorizontalAlignment = $xlRight Edited February 24, 2015 by water JohnOne 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
JohnOne Posted February 24, 2015 Author Share Posted February 24, 2015 Cheers. I was searching for something like that on msdn but could not find it. Got my answer ... http://stackoverflow.com/questions/6952084/excel-cell-alignments-numerical-values-for-e-g-xlleft-xlright-or-xlcenter robertocm 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
iamtheky Posted February 24, 2015 Share Posted February 24, 2015 you cant just whip out -4152 in front of muggles. JohnOne 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now