Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Needed Macro and Function Help

Using Excel 2003 I have 2 Workbooks.

MY GOAL...
WB1, worksheet "Input Data" needs to search for an entry in column B of WB2,
worksheet "Data Sheet". If the value IS FOUND, then I need to replace the
entire row with new data from WB1 into a destination location in WB2. If the
invoice number IS NOT FOUND, then I need to add a complete new entry into WB2.

I already have code for WB2 (although currently used in a macro and not a
function) that will perform the search and tell me the row/column location an
entry is found at, or not at all.

MY NEEDS:
1) In the macro from WB1, I need to pass the value to search in WB2. I felt
a Function (changing the current code from a macro) would be best for this.
What is the correct call for this?

I have tried numerous iterations in 2 test sheets to no avail, such as...
ReturnValue = Application.Run("WorkbookName!LocatePrevRec Range("B4")")
'where Range("B4") is the value being passed

AND

ReturnValue = Application.Run("Invoices & Work
Estimates.xls!LocatePrevRec I-100415") 'where I-100415 is the value being
passed

2) How is the Function in WB2 to be coded to to be able to pick up the input
parameter? I tried starting with (but I get an error)... Function
LocatePrevRec(incomingValues)

3) How do I ensure the "LocatePrevRec" function does the search within WB2,
where the function is located?

4) From WB2, how do I pass back and receive the resulting details from WB2
Function?

BTW - both WBooks are open during all this.

So in summary, I need WB1 to pass a parameter to WB2; WB2 needs to send back
to the caller in WB1 the results.

Signed,
Desperately Needing Help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Needed Macro and Function Help

PLEASE DO NOT RESPOND TO THIS. I should have placed this under "Excel
Programming". It will be posted again.

"GEdwards" wrote:

Using Excel 2003 I have 2 Workbooks.

MY GOAL...
WB1, worksheet "Input Data" needs to search for an entry in column B of WB2,
worksheet "Data Sheet". If the value IS FOUND, then I need to replace the
entire row with new data from WB1 into a destination location in WB2. If the
invoice number IS NOT FOUND, then I need to add a complete new entry into WB2.

I already have code for WB2 (although currently used in a macro and not a
function) that will perform the search and tell me the row/column location an
entry is found at, or not at all.

MY NEEDS:
1) In the macro from WB1, I need to pass the value to search in WB2. I felt
a Function (changing the current code from a macro) would be best for this.
What is the correct call for this?

I have tried numerous iterations in 2 test sheets to no avail, such as...
ReturnValue = Application.Run("WorkbookName!LocatePrevRec Range("B4")")
'where Range("B4") is the value being passed

AND

ReturnValue = Application.Run("Invoices & Work
Estimates.xls!LocatePrevRec I-100415") 'where I-100415 is the value being
passed

2) How is the Function in WB2 to be coded to to be able to pick up the input
parameter? I tried starting with (but I get an error)... Function
LocatePrevRec(incomingValues)

3) How do I ensure the "LocatePrevRec" function does the search within WB2,
where the function is located?

4) From WB2, how do I pass back and receive the resulting details from WB2
Function?

BTW - both WBooks are open during all this.

So in summary, I need WB1 to pass a parameter to WB2; WB2 needs to send back
to the caller in WB1 the results.

Signed,
Desperately Needing Help

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
Detailed Function (or Macro) Needed... Help akemeny Excel Worksheet Functions 3 September 16th 08 07:32 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
macro or function help needed for adding columns for values missin Arain Excel Discussion (Misc queries) 10 May 17th 07 12:46 AM
HELP NEEDED FOR IF Function Inside a Macro Sandi Excel Worksheet Functions 1 June 2nd 06 04:14 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM


All times are GMT +1. The time now is 05:54 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"