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.
Bookmarks