Results 1 to 5 of 5

Thread: Excel 2007 VBA event before a selction changes...

  1. #1
    Join Date
    Nov 2008
    Posts
    6

    Excel 2007 VBA event before a selction changes...

    I am trying to create a spreadsheet in which I have information that can be changed by the user, and I want this information to update after the change is made, but before the selection is changed to the new cell location.

    Is there some way to reference the cell that the change was made in after the selection has been changed, or is there an event that will allow me to calculate the changes as the ActiveCell before the selection changes to any other cell??

    regardless if I use the Worksheet_Change() or Worksheet_SelectionChange() functions, it still moves to a new cell, and ActiveCell is now the new cell, and not the cell where the change was made.

    Please help, and Thank you ever so much in advance...

    Jeff

  2. #2
    Join Date
    Apr 2008
    Posts
    4,642

    Re: Excel 2007 VBA event before a selction changes...

    No problem BlargMaN !!! I have deleted the post that was (by mistake) duplicated....

    However, you can use the task scheduler. Save it as "SaveExcel.vbs" to automate the task and this will automatically save the updated information before the next event takes place.

  3. #3
    Join Date
    Nov 2008
    Posts
    6

    Re: Excel 2007 VBA event before a selction changes...

    I'm not actually looking to save the data, but I am actually looking for a coded vba event to happen on the cell that changed when the selection changes... I am just unsure of how to reference the cell that change was made in once the activecell has been changed...

    I guess i could in theory create a public variable that could reference the currently selected cell, and every time the Worksheet_SelectionChange event is called, have it update that varibale... this should (in theory) allow me to reference that variable instead of ActiveCell...

    I'll give that a shot, and let you guys know...

  4. #4
    Join Date
    Nov 2008
    Posts
    6

    Re: Excel 2007 VBA event before a selction changes...

    Ok... Here's the deal... evidently I wasn't paying any attention to the fact that the Worksheet_Change() function has a "Target" variable that references the cell that was changed...

    Silly Me... Programming is for smart, observant people... lol

    8)~

  5. #5
    Join Date
    May 2008
    Posts
    4,831

    Re: Excel 2007 VBA event before a selction changes...

    For that you need to create VBA code before accessing the commands , the Developer tab must be visible in the Excel 2007 Ribbon user interface. An selection_change event macro is a private worksheet macro, so it cannot directly change cells (copy/paste into cells) in another worksheet. If this is what you are trying to do, you need to write a regular module macro to do this and then call this regular macro from inside the event macro.

Similar Threads

  1. Excel 2003 Macro doesn't work in Excel 2007
    By jjaw in forum Windows Software
    Replies: 3
    Last Post: 03-01-2014, 03:28 PM
  2. Excel 2007 file fails to get permission to open in Excel 2011
    By Raju Chacha in forum Windows Software
    Replies: 6
    Last Post: 13-01-2012, 09:17 PM
  3. Replies: 6
    Last Post: 17-05-2011, 10:00 PM
  4. Embedded Excel 2007 workbook gives error in Word 2007.
    By Milo D in forum Windows Software
    Replies: 5
    Last Post: 25-04-2011, 06:56 AM
  5. Installing Excel 2007 and later adding Word 2007
    By Jemond in forum Office Setup
    Replies: 1
    Last Post: 10-04-2008, 08:12 AM

Tags for this Thread

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
  •  
Page generated in 1,751,217,884.70004 seconds with 16 queries