+ Reply to Thread
Results 1 to 2 of 2

Declared ranges multiplication problem.

Hybrid View

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    Modesto, CA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Declared ranges multiplication problem.

    Can someone help me to figure out what is wrong with my code. I'm trying to multiply two declared ranges, Length and Width, and place the product on my CCFootagesS declared range.
    I've attached a copy of my project. Thanks.
    Public CCFootageS As Range
    Public Length As Range
    Public Width As Range
    Sub CCPublish()
        Set CCFootageS = Range("TPC[CCFootage-S]")
        Set Length = Range("TPC[Length]")
        Set Width = Range("TPC[Width]")
        
        CCFootagePS
    
    End Sub
    Sub CCFootagePS()
        CCFootageS = Length * Width
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937

    Re: Declared ranges multiplication problem.

    Sub CCFootagePS()
        Dim LArray As Variant, _
            WArray As Variant, _
            
        LArray = Length.Value
        WArray = Width.Value
    
    '  convert rows to columns
        WArray = WorksheetFunction.Transpose(WArray)
           
        CCFootageS = WorksheetFunction.MMult(LArray, WArray)
    You can also put the formula directly in the worksheet. Select the four cells of TPC[CCFootage-S]
    enter this array formula in the formula bar:
    =MMULT(TPC[Length],TRANSPOSE(TPC[Width]))
    and commit with Ctrl+Shift+Enter
    Last edited by protonLeah; 02-07-2014 at 06:42 PM.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problem with public global declared variables
    By vonb3ta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2013, 07:20 AM
  2. Subtraction, division, multiplication of ranges
    By MaritaD in forum Excel General
    Replies: 2
    Last Post: 10-28-2006, 04:42 AM
  3. Multiplication problem- Please Help!
    By millzenator in forum Excel General
    Replies: 8
    Last Post: 05-17-2006, 10:28 AM
  4. Multiplication problem
    By Ali Baba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2005, 08:05 PM
  5. [SOLVED] multiplication problem
    By FM in forum Excel General
    Replies: 10
    Last Post: 04-21-2005, 11:06 AM

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