+ Reply to Thread
Results 1 to 8 of 8

Activating a cell ready for user to enter data into

  1. #1
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Activating a cell ready for user to enter data into

    Hi,

    I have some code to create a new row with formulas etc. and then the first cell the user needs to enter data into is selected.
    However when testing and I type in some data it doesn't go into the selected cell.

    Please Login or Register  to view this content.
    Neither of the above lines make that cell the active cell for entering data into....

    Hopefully what I'm trying to do makes sense and hopefully there is an easy solution!

    Thanks in advance
    Harribone
    Say thanks, click *

  2. #2
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Activating a cell ready for user to enter data into

    Couldn't you just record a macro of what you want it to do?

  3. #3
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Activating a cell ready for user to enter data into

    Quote Originally Posted by Harribone View Post
    Hi,

    I have some code to create a new row with formulas etc. and then the first cell the user needs to enter data into is selected.
    However when testing and I type in some data it doesn't go into the selected cell.

    Please Login or Register  to view this content.
    Neither of the above lines make that cell the active cell for entering data into....

    Hopefully what I'm trying to do makes sense and hopefully there is an easy solution!

    Thanks in advance
    Harribone

    Create a macro and enter this code:

    Sub Macro1()
    '
    '
    '

    '
    Rows("2:2").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A2").Select
    End Sub


    This will create a new row and automatically select the first cell in the new row for data to be entered.



    Range("A2").Select <--should work
    Last edited by LukeGilfoyle; 10-29-2015 at 10:09 AM.

  4. #4
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Activating a cell ready for user to enter data into

    Hi Luke,

    Unfortunately recording a macro won't give me the answer. The complete code for what I am doing is this:

    Please Login or Register  to view this content.
    Everything is fine and does its job except for the last bit where I try to select a specific cell so the user doesn't have to scroll down to it etc. Even though the cell is selected on screen Excel doesn't seem to think it is the active cell and the user then has to click on that cell again before Excel realises that is where you want to type in data (in my case an Item Code).

    I would go down a userform route to allow the user to enter data for the new row but at this stage it's not really a necessity and this odd 'bug' is driving me nuts so I'm trying to figure out what I've done wrong in case I need this again for something.

  5. #5
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Activating a cell ready for user to enter data into

    So surely

    Range("A2").Select

    Should work?

    You wouldn't need to select a whole row to enter data in one cell?

  6. #6
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Activating a cell ready for user to enter data into

    Hi all,

    I've figured out what is going on.

    Basically the code is fine. When I type something the screen renders the data in the previous cell for some reason but as soon as you press enter it shows in the correct cell!

    Maybe something to do with the 'screenupdating' or Excel generally or just my computer. Either way it turns out everything was fine...

    Sorry for wasting everyone's time!

    Regards
    Harribone

  7. #7
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Activating a cell ready for user to enter data into

    Quote Originally Posted by LukeGilfoyle View Post
    So surely

    Range("A2").Select

    Should work?

    You wouldn't need to select a whole row to enter data in one cell?
    Just so you know 'NewRow' is the row number in my code so it is selecting just the one cell after the new row is inserted. I have to insert a new row because I have a footer too.

  8. #8
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Activating a cell ready for user to enter data into

    Well done to you, taught me a lesson also

+ 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] Enter User Input Data into Next Free Cell based on Column Name
    By nKife in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-21-2015, 08:45 PM
  2. [SOLVED] User form - disable checkboxes until ready
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2013, 04:16 AM
  3. [SOLVED] only PC user can enter data in a excel cell
    By Megatronixs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2013, 09:42 AM
  4. Enter data in locked cell from user form
    By ajitexcel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-18-2012, 10:21 AM
  5. Activating the Workbook Name from user input
    By LeapingLizard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2012, 01:13 PM
  6. Activating/De-Activating Comments or only if the Cell is Active.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-31-2011, 11:08 AM
  7. Activating the First Cell Containing Numeric Data in a Table
    By kyrgyzstanart in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2008, 07:29 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