+ Reply to Thread
Results 1 to 6 of 6

Helps with Macros

  1. #1
    lennymos123
    Guest

    Helps with Macros

    I have a datafeed that comes to me everyday i need to format one column
    of arounf 1000 rows so it multiples the total column but a 1000 so
    getting rid of the decimal point i.e =A3100.00 becoming 10000 , i also
    need to do this using a macro. can anyone help


  2. #2
    Dave Peterson
    Guest

    Re: Helps with Macros

    One way of doing this manually is to find an empty helper cell, put 100 in that
    helper cell.

    Then copy that helper cell.
    Select your range to adjust.
    edit|paste special|and check the multiply operation.

    Then clean up that helper cell.

    In code, you could do the same thing like this:

    Option Explicit
    Sub testme()
    Dim myRng As Range
    Dim myHelperCell As Range

    With ActiveSheet
    Set myRng = .Range("c4", .Cells(.Rows.Count, "C").End(xlUp))
    Set myHelperCell = .Cells.SpecialCells(xlCellTypeLastCell).Offset(1, 1)
    End With

    With myHelperCell
    .Value = 100
    .Copy
    myRng.PasteSpecial operation:=xlPasteSpecialOperationMultiply
    .Clear
    End With

    End Sub

    (I used C4 through the last used cell in column C. Adjust if necessary.)

    lennymos123 wrote:
    >
    > I have a datafeed that comes to me everyday i need to format one column
    > of arounf 1000 rows so it multiples the total column but a 1000 so
    > getting rid of the decimal point i.e £100.00 becoming 10000 , i also
    > need to do this using a macro. can anyone help


    --

    Dave Peterson

  3. #3
    Don Guillett
    Guest

    Re: Helps with Macros

    One way for column A

    Sub changenums()
    Set mr = Range("a1:a" & Cells(Rows.Count, 1).End(xlUp).Row)
    With mr
    .Formula = .Formula * 100
    .NumberFormat = "0"
    End With
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "lennymos123" <[email protected]> wrote in message
    news:[email protected]...
    I have a datafeed that comes to me everyday i need to format one column
    of arounf 1000 rows so it multiples the total column but a 1000 so
    getting rid of the decimal point i.e £100.00 becoming 10000 , i also
    need to do this using a macro. can anyone help



  4. #4
    lennymos123
    Guest

    Re: Helps with Macros

    Hi Don ive tryed to use your code and having problems with line

    ..Formula = .Formula * 100

    could you help

    Regards

    Paul


  5. #5
    Don Guillett
    Guest

    Re: Helps with Macros

    You're right. I only tested with ONE value. Use Dave's

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "lennymos123" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Don ive tryed to use your code and having problems with line
    >
    > .Formula = .Formula * 100
    >
    > could you help
    >
    > Regards
    >
    > Paul
    >




  6. #6
    lennymos123
    Guest

    Re: Helps with Macros

    Ihave tryed to use both and keep getting errors i used yours again Don
    with the 1 value and it works perfectly , is ther a way of adjusting it
    to work. The rows that come from the feed every day are always between
    800-900 items , so if i just changed the value manually everyday thats
    not a problem.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1