Macro to copy a VLOOKUP formula - Data with a filter on

Hello,

I was wondering if somebody could help me with this macro…

I have some data with a filter on, so that only the rows with blank cells 
are showing.
I want to enter a VLOOKUP in the cell, and copy it down to all the blank 
cells. I tried just recording a macro, but when I run the macro it doesn’t 
work.

Any ideas of how to do it?

Example:

1)
Before the filter:

Colums  A -B - C
            A   x    x   - 1st Row
            A              - 2nd Row
            A    x   x  - 3rd  Row
            A              - 4th row
A    x   x  - 5th row

2) 
After the filter (filter – blanks):

Colums  A -B - C
            A              - 2nd Row
            A              - 4th row

3)
Enter  VLOOKUP in A2,B2 and copy it down to B4 and C4 

Hope I made sense...

Thanks!


0
Utf
3/23/2010 8:48:05 AM
excel.programming 6508 articles. 2 followers. Follow

0 Replies
1090 Views

Similar Articles

[PageSpeed] 43

Reply:

Similar Artilces:

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

create a formula by using text from other cells
I need to effectively use multiple If/Vlookup functions. i.e. if it's Oranges, Lookup price history in "oranges worksheet". But I have too many categories to search in so this is not possible. So I had another solution, but can't make it work... In this case I am using a VLOOKUP formula and want to use one cell to search on (a1) and another cell to tell it which spreadsheet to search in (Sheet2) i.e. =Vlookup(a1,'[WorkbookData.xlsx](CellA2 i.e.Worksheet Name),2,False) So is there a way to create a formula that uses text from another cell? INDIRECT is yo...

Conditional Formula
Hello, I would like some help in evaluating the value of a cell that falls within a certain range. For example: If A2 is less than 1 and greater than 10 "TRUE" Your help is appreciated. Ed Hi Eduardo do you mean if A2 is less than 1 OR greater than 10??? if so format / conditional formatting formula is =OR($A2<1,$A2>10) or if you mean greater than 1 and less than 10 =AND($B1>1,$B1<10) Cheers JulieD "Eduardo" <Eduardo@discussions.microsoft.com> wrote in message news:00BD63BC-81A8-41B9-86F0-BAE57246B86C@microsoft.com... > Hello, > I would li...

Hyperlink to a bookmark created in Word and copied to Windows Mail don't work
A bookmark created in Windows Mail along with the hyperlink to it don't work when copied to Windows Mail for e-mailing I get an error message: mid://00000174/ ...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Copying a variable nuimber of rows
I want to copy the most recent 10 rows (excluding the header row) from worksheet A to worksheet B. My problem is how do I define a variable number of rows if there are fewer than 10 lines completed? I do not want to copy any blank lines. I am fairly new to VBA and am struggling to work out the code for this so any help will be gratefully appreciated. John Try With Activesheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row if LastRow > 10 Then FirstRow = LastRow - 9 Else FirstRow = 1 EndIf ...

Stupid 'Copy' button
Hi, Why does RMS preserve quantity and commited values & serial numbers (amongst others) when you are use the 'copy' function for setting up a new code - this is crazy!!!! Is there an SQL script available I can use to set the correct committed values for any items which have been created by the 'copy' button? I am going to have to tell the customer perform a physical inventory to get the quantity on hand values correct - but committed is more important to fix straight away as they use this for ordering purposes. Can anyone help me? Regards, Jason. ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Disabling Copy
I have an excel sheet which is protected. When i right click on a cell it can allow me to copy the contents. How can i make the copy to be disabled? Any one out there with an idea? Thanks -- pkrono ------------------------------------------------------------------------ pkrono's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=19532 View this thread: http://www.excelforum.com/showthread.php?threadid=346874 You can do this with Excel 2002/2003. With code you could disable a right-click, but you could still use Edit->Copy in Excel 2000 and earlier. "pk...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Copy picture from word 2003 to word 2007
When I copy a document with a picture from 2003 to 2007 the picture ends up with what looks like a bunch of lines - horizontal. Any way to get rid of this? Your best bet would be to right click the picture in your 2003 document and save the picture to your computer. After this is completed, open Word 2007 and click insert picture. Now browse your computer and find that picture you saved. I'm surprised this happened, but I'm guessing its a compatibility issue between 2003 and 2007. "Daisy" wrote: > When I copy a document with a picture from 2003 to 2007...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

copying from worksheets
I have a file containing a number of different worksheets. The first worksheet is a summary. The other worksheets are named individuals onto a calender. The summary shows what they did each week. I need to copy each individuals detail from the cells in the summary onto their own page, as it is entered. Saves me time copying. Is it possible. For example i dont need Mr Smiths details on Mr Jomnes individual sheet. Mal You might be interested in what the Data > Filter > AutoFilter feature can do for you when applied to the Summary sheet............you can filter so that you see on...

Lost on Vlookup, match, etc....
Can someone walk me through this please? I a workbook that imports a years worth of data from filemaker to be analyzed and charted in excel. It contains several sheets, but I am concerned with worksheet 1 (daily data) and worksheet 2 (bodyweight). Daily data contains the raw data I pull in from Filemaker. It results in a table with a row for each day of the year. It has 12 columns, but in this instance, I am only interested in 2 of the colums Column F, (Date), and Column R (Bodyweight). There is only one entry per week for body weight. The bodyweight sheet has 3 columns (week #, date, and w...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

Can i print copy numbers?
At my job we must print copies of databases and keep track of them. We only print 100 copies at a time. Is there a way to make it automaticly put "1 of 100" or "copy 1 of 100" in the footer?? You could run a little macro: Option Explicit Sub testme() Dim iCtr As Long For iCtr = 1 To 3 '100 when you're ready With ActiveSheet .PageSetup.RightFooter = "Copy " & iCtr & " of 100" .PrintOut preview:=True 'false when you're ready End With Next iCtr End Sub I used 1 to 3 and pri...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...