PC Review


Reply
Thread Tools Rate Thread

Changing a Macro to fit new use

 
 
Paul_S
Guest
Posts: n/a
 
      23rd Jan 2007
I am using excel 2000 and have a workbook which currently has 2 sheets,
Targets and Individual Store Targets

The Target Sheet has the the Store Name and Towm in column A, and various
targets in columns B, C, D & E, the data starts in Row 4 and currently goes
down to row 109 but is constantly increasing

On the Individual Store Targets sheet I have links to the data on the Targets
sheet and I use the macro below to change the links to each stores name and
targets and print it, my code is below:

Code:

Sub PrintIndividualStoreTargets()
' PrintIndividualStoreTargets Macro
Dim i As Long, ii As Long
Dim FRow As Long
Dim LRow As Long
Dim Rng As Range

Sheets("Individual Store Targets").Visible = True
Sheets("Target").Activate
LRow = Cells(Rows.Count, "A").End(xlUp).Row
FRow = 4

Set Rng = Sheets("Individual Store Targets").Range("A33,A66")
Worksheets("Individual Store Targets").PrintOut

For i = FRow To LRow
ii = i + 1
If i = LRow Then
Rng.Replace What:=i, Replacement:=FRow, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Exit Sub
End If

With Rng
..Replace What:=i, Replacement:=ii, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Worksheets("Individual Store Targets").PrintOut
End With

Next i

Sheets("Individual Store Targets").Visible = False
End Sub



I now need to change this to a workbook with 3 sheets, Targets, Individual
Store Targets and Individual Store Targets Ireland

The Target Sheet has the the Store Name in column A, and various targets in
columns B, C, D & E, the data starts in Row 4 and currently goes down to row
109 but is constantly increasing

On the Individual Store Targets Sheet I have links to the data on the Targets
sheet and on the Individual Store Targets Ireland sheet links to the first
Ireland store which is in Row 34

There are currently 11 stores in Ireland, which will over time increase,
randomly spread across the rows of data

How can I change the macro so that the UK stores data is linked to the
Individual Store Targets sheet and the Ireland stores linked to the
Individual Store Targets Ireland sheet

At the moment the only thing identifying the stores in Ireland is the Town eg
Cork, Dublin etc in column A if necessary I could add another column which
would identify UK and Ireland

Thx in advance for any help

Paul

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with changing a Macro =?Utf-8?B?TWlrZSBSb2dlcnM=?= Microsoft Excel Misc 1 26th Mar 2006 11:51 PM
RE: Help with changing a Macro =?Utf-8?B?TWlrZSBSb2dlcnM=?= Microsoft Excel Misc 0 26th Mar 2006 11:43 PM
Macro for changing path in macro =?Utf-8?B?TmlnZWw=?= Microsoft Excel Programming 2 16th Aug 2005 03:02 PM
Changing Macro Name? Mike Microsoft Excel Programming 4 25th Jan 2005 09:05 PM
Changing Macro Name SSolano Microsoft Outlook Discussion 1 21st Jul 2004 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 PM.