Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bill Healy
 
Posts: n/a
Default 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   Report Post  
ehntd
 
Posts: n/a
Default


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro does not run when data refreshed Larry Lehman Excel Discussion (Misc queries) 0 January 16th 05 08:31 PM
How do I get my personal macro worksheet to open whenever I open . Claudia_R Excel Discussion (Misc queries) 3 December 10th 04 12:59 AM
Executing macro for all worksheet from a different worksheet Biti New Users to Excel 3 December 8th 04 11:05 AM
select worksheet to run macro Hidaya Excel Discussion (Misc queries) 5 December 2nd 04 12:54 AM
Creating new worksheet from existing ddpen Excel Discussion (Misc queries) 2 December 1st 04 11:35 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"