+ Reply to Thread
Results 1 to 8 of 8

problem with macro understaning "ctrl+down" to last entry in table

  1. #1
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Question problem with macro understaning "ctrl+down" to last entry in table

    I have a column of names which gets its info from another sheet. e.g. every cell in this column says something like =a1 (from sheet1)

    basically, when a new employee is added to the spreadsheet on sheet 1... I need to go to sheet two and drag the (=a1) down to a2 to show =a2 so the new name is now copied over to the table on sheet 2.

    I KNOW how to do this, but the person who will be using it doesn't know anything about excel so im trying to create a macro to do it for them in the form of a button.

    what I tried was... recording myself pressing on the top cell in the table, then pressing CTRL down to go to the last entry. then dragging that cell down.

    It works fine for the first press of the button, but I assumed the second press would make the CTRL down command go to the cell I JUST created in the last press of the button but it doesn't - it doesn't do anything on the second press and just repeats same action.

    why doesn't the ctrl down command in code go to the last LAST cell on the second press. >


    I made a hash of explaining this but someone must get what I mean. to help ppl understand - this is the code:


    Please Login or Register  to view this content.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: problem with macro understaning "ctrl+down" to last entry in table

    Why not put something like this into the worksheet module for Sheet 1 - then if anything changes in Column A of your 'master' list, it will refresh the formulae in Sheet2:

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: problem with macro understaning "ctrl+down" to last entry in table

    why not? because I don't have a clue about private subs basically ha..

    cheers, thought ill try and figure this out and apply it to mine to see if it works

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: problem with macro understaning "ctrl+down" to last entry in table

    Or like this......
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: problem with macro understaning "ctrl+down" to last entry in table

    Quote Originally Posted by Muzza86 View Post
    why not? because I don't have a clue about private subs basically ha..

    cheers, thought ill try and figure this out and apply it to mine to see if it works
    Right click Sheet 1 worksheet tab. Click View Code. Paste the code I posted above in the module which appears.

    Return to Excel, and try adding a new value to the bottom of Column A, in Sheet 1. A corresponding formula will appear in Sheet 2.

  6. #6
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: problem with macro understaning "ctrl+down" to last entry in table

    ok let me simplify what im trying to do with exact example sheet.. see attached
    Attached Files Attached Files

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: problem with macro understaning "ctrl+down" to last entry in table

    Does that attachment actually reflect the worksheet structure you will end up working with?

    Did you try following my instructions, to paste that code into the worksheet module? Did it work?

  8. #8
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: problem with macro understaning "ctrl+down" to last entry in table

    I need someone to tell me why my code doesn't work or to edit it. thanks,

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  4. [SOLVED] Data validation: allow entry into a cell if other three cells have "X", "Y" and "Z"?
    By RogerRangeRover in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 04:49 AM
  5. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM

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