+ Reply to Thread
Results 1 to 3 of 3

code not working, possibly combine for better results?

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Powell, near Knoxville, TN
    MS-Off Ver
    Office 2010
    Posts
    26

    code not working, possibly combine for better results?

    This is part of an earlier post but I may not have provided enough info. I'm still searching for the answer.

    I have two codes I would like to combine for a single macro because I can't get the second code to run in Sheet 3. The first code is in the Sheet 3 View Code box.

    Backgound: Cell O152 contains the formula "=A8" I asked the forum for a formula that would cause cell O152 to retain the first value returned. I'm dealing with dates and cell O152 represents the beginning date. O152 should not change although A8 changes. I will paste the code sent provided by Debraj Roy after the first two codes.

    Here is the first code which works fine both with and without the second code. This code is in the Sheet 3 View Code box.

    Please Login or Register  to view this content.
    The second code I've copied here works perfectly by it's self. But when I try to run it with the first code, it is not effective (or is not running).
    The second code is in a module created from Sheet 3.

    Please Login or Register  to view this content.
    Currently, the second code (placed in module 1) is not working on Sheet 3, but it does work on other sheets where I have it in the Sheet View Code box of the sheet.

    Here is the solution provided by Debraj Roy. It produces a new working code from the 1st code, but it does not produce a retained value in cell O152.

    Please Login or Register  to view this content.
    When I look in the View Macros box I see no macros listed. Am I missing a step or something?

    Thanks for the help everyone.

    Russ
    Last edited by Russ Fuquay; 07-23-2013 at 09:25 PM.

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: code not working, possibly combine for better results?

    Try:
    Please Login or Register  to view this content.
    Also note a Work Sheet Event cannot be used in a Module.

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Powell, near Knoxville, TN
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: code not working, possibly combine for better results?

    Thanks Corey Troy and Debraj Roy. Debraj's formula worked for the first part of the process, but not the second. Corey's formula reversed the outcome of the first formula, but worked for the second.

    So I did a little experimenting and found a workable formula based on the ones provided by these two contributors. I've used a red font color to indicate the changes made.

    Please Login or Register  to view this content.
    Thanks. This is a big help to me. I greatly appreciate this forum and the contributions.
    Last edited by Russ Fuquay; 07-24-2013 at 10:45 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need improvement to working code. (Possibly by using an array?)
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2013, 11:11 PM
  2. [SOLVED] Working with Decimals and possibly Concatenation
    By tuoinside in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-26-2012, 04:50 PM
  3. How to combine data from 2 rows, possibly with IF statement involved.
    By sark1014 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2012, 04:31 PM
  4. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM
  5. Unusual error-handling results in previously working code written for Excel 2002
    By guindi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 02:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1