+ Reply to Thread
Results 1 to 3 of 3

VBA/Macro which can multiply 2 columns and output is in the third column

Hybrid View

  1. #1
    Registered User
    Join Date
    03-15-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    1

    VBA/Macro which can multiply 2 columns and output is in the third column

    Need help on how to create a macro which can multiply 2 columns and the output will be in another column.

    e.g.

    Column 1 Column 2 Column 3
    1 5 5
    1.5 8 12

    I have attached a sample snapshot on this. May sound simple for others, but I am a new user.
    Appreciate all the help!
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: VBA/Macro which can multiply 2 columns and output is in the third column

    Something like
    With Range("f2",Range("f" & Rows.Count).End(xlup)).Offset(,2)
         .Formula = "=rc[-2]*rc[-1]"
         .Value = .Value
    End With

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA/Macro which can multiply 2 columns and output is in the third column

    Sub multiple()
    Dim x, i&, LR&
    
     LR = Cells.Find("*", , , , xlByRows, xlPrevious).Row
    For i = 1 To LR
        Cells(i, 3) = Cells(i, 1) * Cells(i, 2)
    Next
    End Sub

+ 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