Results 1 to 1 of 1

Search for results in a separate spreadsheet

Threaded View

  1. #1
    Registered User
    Join Date
    02-08-2008
    Posts
    35

    Search for results in a separate spreadsheet

    I am constructing a macro which would do the following:

    1i)Search through another Spreadsheet "D 2008" for any values in column E4 and beyond matching a variable in the original spreadsheet "TD", and then remove any that didnt match the word "ISP" in column G.

    1ii)It would then copy the values or words in columns B,H,K for the matching rows then return to spreadsheet "TD". If "B" was equal to "IS" paste B,H,K into E-G23, If "B" was equal to "WAS" paste B,H,K to E-G28, if neither of these ignore. It would then add a line after row 23 or 28 and next time the rows would be pasted in row 24 or 29.

    I'm hoping 1ii will be relatively easy but I'd like to hear any suggests for 1i as I can't seem to be able to reference and search another spreadsheet.
    And no I can't merge the two spreadsheets sadly.

    EDIT: I thought I'd bump and show the exact problem in my code. This is what I have so far:-
        While Len(Range("A" & CStr(LSearchRow)).Value) > 0
    
            If Range("E" & CStr(LSearchRow)).Value = (V) Then
                Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
                Selection.Copy
                'Sheets("Sheet2").Select
                Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
                ActiveSheet.Paste
                LCopyToRow = LCopyToRow + 1
                Sheets("Sheet1").Select
    
            End If
    To put it simply before this section of code I would like to have something like 'Spreadsheet("G:\Ref\Book\D 2008.xls").Select', to point at the spreadsheet I am attempting to take data from. I have attempted to record a macro then utilise the code within it but I can't get it to work.
    Any help would be welcome.
    Last edited by sungsam; 02-15-2008 at 11:02 AM.

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