Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
VBA Newbie: Help with Do Loop code
I am extremely new to VBA and Macros, so any help would be greatly
appreciated. Scenario: Lets say I have 2 coulumns in an excel spreadsheet, lets call them A and B. Coulumn A contains names of a company's various departments. The length of this column can vary each time the spreadsheet is produced. I have a macro to run a VLOOKUP based on the contents of column A and enters the required result in column B. At present when I run this macro only the first cell (B1) has data inputted. How can I get the macro to repeat itself until it gets to the bottom of column A (the first empty cell). I assume that I need to use some form of Do Loop, but cannot get the code right. Sub Contact() ' ' Contact Macro ' Macro recorded 01/12/2004 by ' ' Keyboard Shortcut: Ctrl+q ' ActiveCell.FormulaR1C1 = _ "=VLOOKUP(C12,PERSONAL.XLS!Division_Lookup_Table,2 ,FALSE)" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Newbie: Help with Do Loop code | Excel Discussion (Misc queries) | |||
Loop macro for a Newbie | Excel Programming | |||
newbie: stop a FOR NEXT loop | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming |