Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Using Indirect & Creating a worksheet Macro
Worksheet is structured as follows:
Sheet 1 - called "Account Data" Cell A1 = Account Title Cell A2-A250 = Various Account titles Sheet 2 - called "template" Has various, Vlookup's & Indirect Functions, triggered from the sheet name There are no other sheets in the workbook. What I'd like to be able to do is run a marco which: 1) Creates a copy of the "template" 2) Re-names the "tab" with the name contained in cell A2 of sheet named "Account Data" 3) Continues to do the above, moving down the list in "account data (A3,A4,A5, ETC) until it reaches a blank cell, in which case the marco stops running. I can do each task individually from previous advice given via this site, however it would be great if I could do both together. Oh, one final thing, i'd like the marco to run which I do "CTRL X" Hope one of you wizards out there can help! Bill |
#2
|
|||
|
|||
Option Explicit Sub Macro1() Dim i As Integer i = 2 Do Sheets("template").Select Sheets("template").Copy Befo=Sheets(1) Sheets("template (i)").Select Sheets("template (i)").Name = Sheets("Account Data").Range("A2").Value i = i + 1 ActiveCell.Offset(1, 0).Activate Loop Until IsEmpty(ActiveCell) End Sub I think this should do the trick. About the control x... donīt know.. lemme think about it. -- ehntd ------------------------------------------------------------------------ ehntd's Profile: http://www.excelforum.com/member.php...o&userid=15865 View this thread: http://www.excelforum.com/showthread...hreadid=275569 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro does not run when data refreshed | Excel Discussion (Misc queries) | |||
How do I get my personal macro worksheet to open whenever I open . | Excel Discussion (Misc queries) | |||
Executing macro for all worksheet from a different worksheet | New Users to Excel | |||
select worksheet to run macro | Excel Discussion (Misc queries) | |||
Creating new worksheet from existing | Excel Discussion (Misc queries) |