Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 24
Default Changing a Macro for new circumstances

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:

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("A3:D3,A6:D6")
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
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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Changing Macro Folder JDub Excel Discussion (Misc queries) 1 July 31st 06 04:56 PM
link to combobox legepe Excel Discussion (Misc queries) 4 July 26th 06 04:45 PM
Changing trend lines with macro Brisbane Rob Charts and Charting in Excel 1 July 20th 06 11:55 PM
How to stop Excel remembering/loading macro from previously opened Workbook Norman Yuan Excel Discussion (Misc queries) 4 June 17th 06 04:13 PM


All times are GMT +1. The time now is 12:04 AM.

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

About Us

"It's about Microsoft Excel"