+ Reply to Thread
Results 1 to 6 of 6

how to select cells above active cell and do a sum product with other row in VBA

  1. #1
    Registered User
    Join Date
    11-16-2015
    Location
    USA
    MS-Off Ver
    Window 7
    Posts
    28

    how to select cells above active cell and do a sum product with other row in VBA

    Excel forum_1.PNG

    Please see the image above. The formula needs to be dynamic as the valies in data 2 might be moving from column f to column aa and also changing the rows from 4 to 150. but the values of DATA 1 will be in the same column e but same rows as data 2.

    Waiting for advice and feel free to ask any questions. Appreciate your effort in advance!
    Attached Images Attached Images
    Last edited by Raja10; 06-11-2020 at 12:53 PM. Reason: Edited the image to add more detail

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: how to select cells above active cell and do a sum product with other row in VBA

    Hi, this should do the trick:
    Please Login or Register  to view this content.
    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Registered User
    Join Date
    11-16-2015
    Location
    USA
    MS-Off Ver
    Window 7
    Posts
    28

    Re: how to select cells above active cell and do a sum product with other row in VBA

    It worked
    Thank you Erwin!

  4. #4
    Registered User
    Join Date
    11-16-2015
    Location
    USA
    MS-Off Ver
    Window 7
    Posts
    28

    Re: how to select cells above active cell and do a sum product with other row in VBA

    Hello Erwin, a small doubt, what is the purpose of "&" in Dim?

    Dim rn&, cn&, rn1&

  5. #5
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: how to select cells above active cell and do a sum product with other row in VBA

    You don't have to have doubt , it is another way of writing:
    Please Login or Register  to view this content.
    ,etc.

    If the provided solution takes care of the original question, please mark the thread as 'SOLVED' from the Thread Tools menu at top of the page & consider adding reputation(s) to those who have helped by clicking the star under their usernames


    Cheers
    Erwin

  6. #6
    Registered User
    Join Date
    11-16-2015
    Location
    USA
    MS-Off Ver
    Window 7
    Posts
    28

    Re: how to select cells above active cell and do a sum product with other row in VBA

    lol, that was simple. Thank you!

+ 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. Select cells below active row
    By torpido in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2020, 01:58 PM
  2. Using offset function to select a range of cells based on active cell location
    By laxminarayana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-25-2017, 07:49 AM
  3. [SOLVED] Using code to select cells that are two cells to the left of the currently active cell
    By LaffyAffy13 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-25-2013, 01:56 PM
  4. Replies: 1
    Last Post: 07-08-2012, 08:47 AM
  5. [SOLVED] VBA - Can I select a new active cell based on the value of the current active cell?
    By GrumpyOldBastard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2012, 07:05 PM
  6. [SOLVED] How do I select a cell 5 cells from the active cell?
    By JasonK in forum Excel General
    Replies: 3
    Last Post: 03-14-2006, 11:10 AM
  7. [SOLVED] how to select specific cells to product a chart
    By knuuttila in forum Excel General
    Replies: 2
    Last Post: 08-14-2005, 06:05 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