+ Reply to Thread
Results 1 to 5 of 5

Taking cell values from Dashboard, and based on a value load in one of two sheets

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Your House
    MS-Off Ver
    Excel 2003
    Posts
    6

    Taking cell values from Dashboard, and based on a value load in one of two sheets

    Greetings-
    I am happy to say I am new here, and I have looked around, and I am very happy with the meaning of this forum.

    I would like to take a chance to say that I appreciate any advice given with my post.

    So here is what I would like to do. As you can see I have attached a sample workbook of the data I am looking to populate in the two work sheets.

    As you can see the Dashboard pulls from all of the other tabs in the workbook. I would like to take the data that populates in the Dashboard, and filter that so to speak. I know I could do a filter manually, but I am hoping to have this done automatically.

    If you look in the Spreadsheet, under the tabs '>=10' and '<=10', respectfully I would like to take the values in Column B from the sheet Dashboard if the value is greater than 10, to automatically list the whole row in the >=10 sheet. If the cell value in Column B in the sheet Dashboard is less than 10, I would like to have the whole row populated in the <=10 sheet.

    I am not sure if I put this in clear words, if you require more clarification please let me know

    Again Thanks in Advance!!
    Attached Files Attached Files
    Last edited by califire; 01-10-2011 at 10:18 PM. Reason: I left some words out...

  2. #2
    Registered User
    Join Date
    01-10-2011
    Location
    Your House
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Taking cell values from Dashboard, and based on a value load in one of two sheets

    Well this what I was able to come up with, maybe this can be looked at... Currently it runs... however the script pastes the values wrong in a major way. How do I get the out to be the text displayed in the Dashboard? Or even better still how do I get the information to pull from the tabs just in the same way as the Dashboard, w/o display #REF, or other jumble...


    Above10
    Sub SearchForString10()

    Dim LSearchRow As Integer
    Dim LCopyToRow As Integer

    On Error GoTo Err_Execute

    'Start search in row 3
    LSearchRow = 3

    'Start copying data to row 3 in Above10 (row counter variable)
    LCopyToRow = 3

    While Len(Range("A" & CStr(LSearchRow)).Value) > 0

    'If value in column B = ">=11", copy entire row to Above10
    If Range("B" & CStr(LSearchRow)).Value >= "11" Then

    'Select row in Dashboard to copy
    Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
    Selection.Copy

    'Paste row into Above10 in next row
    Sheets("Above10").Select
    Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
    ActiveSheet.Paste

    'Move counter to next row
    LCopyToRow = LCopyToRow + 1

    'Go back to Dashboard to continue searching
    Sheets("Dashboard").Select

    End If

    LSearchRow = LSearchRow + 1

    Wend

    'Position on cell B3
    Application.CutCopyMode = False
    Range("B3").Select

    MsgBox "All matching data has been copied."

    Exit Sub

    Err_Execute:
    MsgBox "An error occurred."

    End Sub

    Below10

    Sub SearchForString()

    Dim LSearchRow As Integer
    Dim LCopyToRow As Integer

    On Error GoTo Err_Execute

    'Start search in row 3
    LSearchRow = 3

    'Start copying data to row 3 in Below10 (row counter variable)
    LCopyToRow = 3

    While Len(Range("A" & CStr(LSearchRow)).Value) > 0

    'If value in column B = "Below10", copy entire row to Sheet2
    If Range("B" & CStr(LSearchRow)).Value <= "10" Then

    'Select row in Dashboard to copy
    Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
    Selection.Copy

    'Paste row into Below10 in next row
    Sheets("Below10").Select
    Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
    ActiveSheet.PasteSpecial

    'Move counter to next row
    LCopyToRow = LCopyToRow + 1

    'Go back to Dashboard to continue searching
    Sheets("Dashboard").Select

    End If

    LSearchRow = LSearchRow + 1

    Wend

    'Position on cell B3
    Application.CutCopyMode = False
    Range("B3").Select

    MsgBox "All matching data has been copied."

    Exit Sub

    Err_Execute:
    MsgBox "An error occurred."

    End Sub
    Thank in Advance-

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Your House
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Taking cell values from Dashboard, and based on a value load in one of two sheets

    ... okay my question then, with the code above, how do I just copy the row of text, and not reference the formula... It appears that the formulas are copying into the new sheets... which is causing the errors in the new sheets... Please any advise is appreciated, once this is achieved I will have solved this...

  4. #4
    Registered User
    Join Date
    01-10-2011
    Location
    Your House
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Taking cell values from Dashboard, and based on a value load in one of two sheets

    'Paste row into Above10 in next row
    Sheets("Above10").Select
    Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
    ActiveSheet.PasteSpecial xlPasteValuesAndNumberFormats
    This did the trick... thanks for all the help.

  5. #5
    Registered User
    Join Date
    01-10-2011
    Location
    Your House
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Taking cell values from Dashboard, and based on a value load in one of two sheets

    'If value in column B = ">=11", copy entire row to Above10
    If Range("B" & CStr(LSearchRow)).Value >= "11" Then

    'Select row in Dashboard to copy
    Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
    Selection.Copy
    'If value in column B = "<=10", copy entire row to Below10
    If Range("B" & CStr(LSearchRow)).Value <= "10" Then

    'Select row in Dashboard to copy
    Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
    Selection.Copy

    Ok... last question... I am not even sure if this is being read anymore but I will post it anyways... this snippet... how can I get it to produce anything less than 10 only, and anything greater than 10 only for the other sheet?

    Thanks again...

+ 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