Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think Tom posted his answer to someone else's question here.
"Tom Ogilvy" wrote in message ... That is the essential code of the macro. You need to name it Sub MyMacro() Dim sh as worksheet, nm as String Dim rng as Range, cell as Range set sh = worksheets("sheet1") nm = sh.range("A1").Value with worksheets("Sheet2") set rng = .range(.cells(1,1),.cells(1,1).end(xldown)) End with for each cell in rng if cell.value = nm sh.columns(1).Insert sh.Range("A1").Value = cell.offset(0,1).vlaue end if Next End Sub You need to do Alt+F11 to get to the vbe, then do Insert =Module in the menu there and then paste the code into that module. http://www.mvps.org/dmcritchie/excel/getstarted.htm http://www.mvps.org/dmcritchie/excel....htm#tutorials vba tutorials listed after the excel tutorials. -- Regards, Tom Ogilvy "phil2006" wrote: Thanks! I still don't quite understand where I put this into tho? Is this the macro? Please excuse my ignorance! -- phil2006 ------------------------------------------------------------------------ phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092 View this thread: http://www.excelforum.com/showthread...hreadid=549433 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming | |||
Macros inside macros, and pasting into macro code. | Excel Programming | |||
convert lotus 123w macros to excel macros | Excel Programming | |||
Macros not appearing in the Tools Macro Macros list | Excel Programming | |||
Suppress the Disable Macros / Enable Macros Dialog | Excel Programming |