how to right justify format a new entry to a worksheet
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: how to right justify format a new entry to a worksheet

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    John G
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Try the following: -

    With Workbooks(WB1).Sheets(shtName).Range("A" & x)
    .Value = chgprod.ret
    .HorizontalAlignment = xlRight
    End With

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com