Consulting

Results 1 to 2 of 2

Thread: Formating Macro

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location

    Formating Macro

    Hi

    I need assistance on a macro that well once i have imported the data in a excel worksheet. I have attached the work book

    to do the following on the click of a macro button

    1. convert the the value in col H to % (2 demical places)

    2. Columns G, I, J, K, M, N - to be shown as values in 1000, sepearted by a comma (0 demical places) i.e 23504.000 = 23,504

    3. Hide always column L

    4. Delete columns O and P always.

    thanks.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Macro1()
    Columns("H:H").NumberFormat = "#,##0.00"
    Range("G:G,I:I,J:J,K:K,M:M,N:N").NumberFormat = "#,##0"
    Columns("L:L").Hidden = True
    Columns("O:P").Delete Shift:=xlToLeft
    End Sub
    [/vba]

    Ain't the macro recorder wonderful?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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