JohnOne Posted February 24, 2015 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.
JohnOne Posted February 24, 2015 Author 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.
Solution water Posted February 24, 2015 Solution 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
JohnOne Posted February 24, 2015 Author 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.
iamtheky Posted February 24, 2015 Posted February 24, 2015 you cant just whip out -4152 in front of muggles. JohnOne 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
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