![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: John G
Posts: 62
|
How do I control the postition of an entry that I placed into a worksheet. I have formated a variable as so:
chgprod.ret = Format(chgprod.ret, "#,##0.00") and then I have written it to a worksheet using workbooks(WB1).sheets(shtName).range("A" & x) = chgprod.ret Is there a way to insure that what goes into range("A" & x) is right justified? The data that was in that location before was right justified so I'm assuming that I changed the format somehow. Any help would be greatly appreciated. Thanks, John |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Try the following: -
With Workbooks(WB1).Sheets(shtName).Range("A" & x) .Value = chgprod.ret .HorizontalAlignment = xlRight End With |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|