+ Reply to Thread
Results 1 to 3 of 3

I need a formula

  1. #1
    Registered User
    Join Date
    10-23-2006
    Posts
    2

    I need a formula

    Hi everyone!
    I have this workbook (attached). What I want is a formula or a macro that will automaticly create a list in the "Total" sheet starting in B2, depending on what options are selected with a "x" sign in the "Options" sheet.
    Can anyone help me?

    Thanks!
    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,624
    PHP Code: 
    Sub get_totals()
         
    Dim TotalsRow As IntegerOptionsRow As Integer
         
    'Set the starting rows'
         
    TotalsRow 2
         OptionsRow 
    3
         Worksheets
    ("options").Select
         
    While Cells(OptionsRow2).Value <> ""       'continue while Col-B has data'
              
    If Cells(OptionsRow1).Value "x" Then
                   Worksheets
    ("Total").Range("b" TotalsRow).Value Cells(OptionsRow2).Value
                   Worksheets
    ("Total").Range("c" TotalsRow).Value Cells(OptionsRow3).Value
                   TotalsRow 
    TotalsRow 1     'select next empty total row only if data was copied'
              
    End If
              
    OptionsRow OptionsRow 1     ' get next options row to test'
         
    Wend
    End Sub 
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-23-2006
    Posts
    2

    Thumbs up

    It works perfectly
    Thanks!

+ 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