is it because highlighted line has EXTRACTEDDATA and elsewhere it reads EXTRACTEDLIST
I edited the macro to read extractedlist and the macro ran but with no data on the extractedlist sheet
Small change to the code:
Code:Sub ExtractData() 'JBeaucaire 2/16/2010 Dim LR As Long Dim wksExtract as Worksheet Application.ScreenUpdating = False Set wksExtract = Sheets("ExtractedList") wksExtract.Cells.Clear With Sheets("Data") LR = .Range("A" & .Rows.Count).End(xlUp).Row .Range("F1") = "Key" .Range("F2:F" & LR).FormulaR1C1 = "=ISNUMBER(MATCH(RC1,MasterList!C1,0))" .Range("F:F").AutoFilter Field:=1, Criteria1:="TRUE" .Range("A1:E" & LR).Copy wksExtract.Range("A1") .AutoFilterMode = False .Range("F:F").ClearContents End With Application.ScreenUpdating = True wksExtract.Activate Beep End Sub
So long, and thanks for all the fish.
all sorted.
changed from extracteddata to extractedlist in the macro wording and my problem was i was running bootcamp with mac leopard and windows side by side.
I then copied new data from the excel file open on the mac into the data file on win 7 and thats when data disappeared on the extracted sheet.
I then copied the file from the mac to win 7, opened it, copied the new data, pasted into the data sheet and the macro worked fine.
The mac really does not like vbm and my fault for copying data from an open program.
Once again, many thanks and sorry for the rambling posts but we got there in the end!
JBeaucaire's code assumes you have the data sheet active when you start. If you don't (e.g. you have the ExtractedList sheet active), it won't work properly.
Office 2008 doesn't support VBA but prior versions do, and supposedly the next version will again, from what I hear. Your alternative in 2008 is to use Applescript.
So long, and thanks for all the fish.
No, that last line of code just brings up the extracted list onscreen. Sorry about the typo.
I don't use a MAC, so I can't give you Mac specifics about macro usage. This is how I would install the macro into my workbook:
How/Where to install the macro:
1. Open up your workbook
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save your sheet
The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
As mentioned, Office 2008 doesn't support VBA. Sad, but true.
So long, and thanks for all the fish.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Yes it does:
Your last row variable depends on the active sheet.Code:LR = Range("A" & Rows.Count).End(xlUp).Row![]()
So long, and thanks for all the fish.
Duh, you're right, it does. But you guessed incorrectly at which sheet should be active...my bad for making you guess.
Code:Option Explicit Sub ExtractData() 'JBeaucaire 2/16/2010 Dim LR As Long Application.ScreenUpdating = False Sheets("ExtractedList").Cells.Clear With Sheets("Data") LR = .Range("A" & .Rows.Count).End(xlUp).Row 'moved to here .Range("F1") = "Key" .Range("F2:F" & LR).FormulaR1C1 = "=ISNUMBER(MATCH(RC1,MasterList!C1,0))" .Range("F:F").AutoFilter Field:=1, Criteria1:="TRUE" .Range("A1:E" & LR).Copy Sheets("ExtractedList").Range("A1") .AutoFilterMode = False .Range("F:F").ClearContents End With Application.ScreenUpdating = True Sheets("ExtractedData").Activate Beep End Sub
Last edited by JBeaucaire; 02-16-2010 at 12:52 PM. Reason: Moved LR variable into WITH
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
How does that differ from what I posted?![]()
So long, and thanks for all the fish.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks