Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Trigger code if certian data is present

I have a worksheet that summarises a data sheet that is updated by the user
by copying a file created by another application.

Occassionally the data will contian "Normal" instead of "Norm" as a line
characteristic. I have a macro that will find "Normal" on the datasheet
("JobCard") and replae each instance with "Norm".

However, I have no guarantee that the user will remember to press the button
that runs this macro.

Is it possible for the datasheet ("JobCard") to be tested after being
updated (new Job Card pasted in) and any instance of "Normal" changed to
"Norm" before the user accesses the Summary sheet, or once each time the
Summary sheet is activated?

I have tried running the macro as a worksheet event, but get myself caught
up in circular process that I have to break out of.

Any suggestions greatly appreciated
Jim
--
Jim
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Trigger code if certian data is present

Would the Worksheet_Deactivate event suit your needs?

Try calling your search & replace from this event, so it fires when another
sheet is selected. Also call it from the Workbook_BeforeSave event? - In
which case the search & replace will have to refer explicitly to the JobCard
sheet.

HTH
Roger




"Jim G" wrote in message
...
I have a worksheet that summarises a data sheet that is updated by the user
by copying a file created by another application.

Occassionally the data will contian "Normal" instead of "Norm" as a line
characteristic. I have a macro that will find "Normal" on the datasheet
("JobCard") and replae each instance with "Norm".

However, I have no guarantee that the user will remember to press the
button
that runs this macro.

Is it possible for the datasheet ("JobCard") to be tested after being
updated (new Job Card pasted in) and any instance of "Normal" changed to
"Norm" before the user accesses the Summary sheet, or once each time the
Summary sheet is activated?

I have tried running the macro as a worksheet event, but get myself caught
up in circular process that I have to break out of.

Any suggestions greatly appreciated
Jim
--
Jim



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Trigger code if certian data is present

Thanks Roger,
This looked promising at first but when I tried to select the "Summary"
sheet the error message, 'Can't find any data to replace...' would come up
and I can't then get to the "Summary" sheet from "JobCard".

This is the code.

Private Sub Worksheet_Deactivate()
Sheets("JobCard").Select
Selection.Replace What:="Normal", Replacement:="Norm", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Sheets("Summary").Select
Range("B4").Select

End Sub

With or without 'Sheets("Summary").Select' causes the circular action and I
can't get to any other sheet because of the error message bring me back to
"JobCard".
--
Jim


"Roger Whitehead" wrote:

Would the Worksheet_Deactivate event suit your needs?

Try calling your search & replace from this event, so it fires when another
sheet is selected. Also call it from the Workbook_BeforeSave event? - In
which case the search & replace will have to refer explicitly to the JobCard
sheet.

HTH
Roger




"Jim G" wrote in message
...
I have a worksheet that summarises a data sheet that is updated by the user
by copying a file created by another application.

Occassionally the data will contian "Normal" instead of "Norm" as a line
characteristic. I have a macro that will find "Normal" on the datasheet
("JobCard") and replae each instance with "Norm".

However, I have no guarantee that the user will remember to press the
button
that runs this macro.

Is it possible for the datasheet ("JobCard") to be tested after being
updated (new Job Card pasted in) and any instance of "Normal" changed to
"Norm" before the user accesses the Summary sheet, or once each time the
Summary sheet is activated?

I have tried running the macro as a worksheet event, but get myself caught
up in circular process that I have to break out of.

Any suggestions greatly appreciated
Jim
--
Jim




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
taking certian data from worksheet one to worksheet 2 [email protected] Excel Worksheet Functions 1 September 12th 06 09:01 AM
Taking Certian Data only from 2 Spreadsheets william4444 New Users to Excel 2 June 5th 06 01:14 PM
Averages excluding certian data bbddvv Excel Discussion (Misc queries) 11 November 11th 05 08:03 PM
Data present bach Excel Discussion (Misc queries) 5 September 7th 05 12:10 AM
How to present the error margin of data set? Wess Excel Discussion (Misc queries) 1 April 11th 05 02:47 PM


All times are GMT +1. The time now is 07:32 PM.

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"