+ Reply to Thread
Results 1 to 8 of 8

Code running in wrong sheet

  1. #1
    Registered User
    Join Date
    07-21-2008
    Location
    Minnesota
    Posts
    7

    Code running in wrong sheet

    I am trying to copy a row of cells down to the last entry of a corresponding cell. i.e. like when you double click on the bottom right hand corner of a cell and it copies downward until there are no values around it.

    I can get the code to run on Sheet 1 but I need it to work on Sheet 2 and can't figure out how to do that. Basically it does what I want just using the wrong sheet, (But correct cell references).

    Here is the entirety of the code, I've made the troublesome part red:

    Please Login or Register  to view this content.
    Thanks in advance for the help!

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi cgeistman,

    Perhaps you just need to select the sheet "Compacted JIT" before your code in red:

    Please Login or Register  to view this content.
    Hope this helps

    Seamus

  3. #3
    Registered User
    Join Date
    07-21-2008
    Location
    Minnesota
    Posts
    7
    I get a 400 Error with that...

  4. #4
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi cgeistman,

    I put your code into a new workbook, renamed "Sheet2" to "Compacted JIT", put some data (first numerical then alpha along with some " ") into Column A of Sheet 1, then put a simple formula in B3, C3, D3 of "Compacted JIT" (ie "=A3"), stepped through the macro and it appeared to work - deleting the blanks, copying the values to "Compacted JIT", and filling in the formulae.

    Unless I'm doing something different I can't see why you still get the error.

  5. #5
    Registered User
    Join Date
    07-21-2008
    Location
    Minnesota
    Posts
    7
    I can't get it to work, I keep getting the 400 error.

    I wonder if it has anything to do with my formulas?

  6. #6
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi cgeistman,

    Perhaps you could post one or two of the formulae for us to have a look at (I presume they are in "Compacted JIT") and see if anyone can help out

  7. #7
    Registered User
    Join Date
    07-21-2008
    Location
    Minnesota
    Posts
    7
    SOLVED!

    I had my Macro in Sheet 1, not in the workbook so I couldn't select any other sheets.

    Thanks for the help SOS!

  8. #8
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Glad you got it solved - just happy it was something simple like that

    Regards

    Seamus

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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