+ Reply to Thread
Results 1 to 17 of 17

Default Value in a cell on a click.

  1. #1
    Registered User
    Join Date
    12-27-2006
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    87

    Default Value in a cell on a click.

    I am producing a tablet friendly version of a excel spreadsheet. I have many data validation tables (click down and select). I have series of cells where only one value ("1") is needed. I was wondering if there is an option where a value can be defaulted to a cell on a click only. So that if a clicked (or even double clicked), a value of "1" will automatically populate that cell. I understand excel will not run macros on tablets. Thank you for your help.
    Bob

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Default Value in a cell on a click.

    Excel will run macros on tables. Properly written, you could likely use the Worksheet_SelectionChange event to do what you want. But I don't want to tackle it tonight. Maybe tomorrow if nobody else jumps in.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Default Value in a cell on a click.

    This assume the range to receive the value of '1' is in column A. You can change the code to the range you want the procedure to apply to. For example, if you want to use B10:C20 then change 'Range("A:A") in thise line:
    Please Login or Register  to view this content.
    to Range("B10:C20")

    Please Login or Register  to view this content.
    The ranges are worksheet ranges and not table ranges. To use the macro, copy and paste it into the sheet code module for the worksheet where you want it to apply. Once installed, you can click in the cells you want the 1 to appear in and it will automatically populate the cell. To remove the 1 from the cell, click in the cell, then press the Delete key.
    Last edited by JLGWhiz; 05-27-2020 at 10:02 AM.

  4. #4
    Registered User
    Join Date
    12-27-2006
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    87

    Re: Default Value in a cell on a click.

    Thank you so much for your time JLGWhiz. I couldn't get this to work. Attached is this copy. I am obviously doing something wrong.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Default Value in a cell on a click.

    You need to put the code into the sheet1(Bet Finder) module.
    However it work on an android tablet, if that's what you want.

  6. #6
    Registered User
    Join Date
    12-27-2006
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    87

    Re: Default Value in a cell on a click.

    Ok. Thanks for that Fluff13.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Default Value in a cell on a click.

    I don’t think VBA works on any mobile device.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    12-27-2006
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    87

    Re: Default Value in a cell on a click.

    Thanks AliGW. I just found that out. Back to the drawing board.

  9. #9
    Registered User
    Join Date
    12-27-2006
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    87

    Re: Default Value in a cell on a click.

    So, VBA won't run on tablets. However it would be great is I could get it to work on my laptop. I need to enter "1" columns I:P. To streamline this process I was hoping to click in the cell for a 1 to be entered. Still not working on laptop. I apologise for my incompetence.
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Default Value in a cell on a click.

    Delete the two modules that you have added & then follow the instructions in post#5.

    @AliGW
    Not something I've ever tried & could well be wrong, but I think you can use VBA on windows devices.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Default Value in a cell on a click.

    I can’t find anything online, even on MS sites, that says anything other than the mobile version of Excel does not support VBA. Happy to be proved wrong ...

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Default Value in a cell on a click.

    I'm probably the one's that wrong, just thought I'd seen something that said windows based tablets could run VBA. Maybe I'm just going mad, having been cooped up at home for 68 days & counting

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Default Value in a cell on a click.

    Well, we’ve all been in lock-down, so we are probably all mad by now.

  14. #14
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Default Value in a cell on a click.

    Well, we’ve all been in lock-down, so we are probably all mad by now.
    From Disney's adaptation of one of my favorite books: https://www.youtube.com/watch?v=hTLOlf5My6w

    Now, back to your regularly scheduled programming.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  15. #15
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Default Value in a cell on a click.

    It did not take COVID-19 to make me nuts! I just realized that the OP said tablets, not tables.
    Last edited by JLGWhiz; 05-27-2020 at 08:22 PM.

  16. #16
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Default Value in a cell on a click.

    @Fluff13 & @AliGW - Just for info:

    https://www.excelforum.com/the-water...d-tablets.html

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Default Value in a cell on a click.

    Yes, that’s for full Windows 10, so the device would need to be running Excel proper, not the mobile version. 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. My default mail program must open with [email protected] when I click A1 cell...
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2015, 10:05 AM
  2. Replies: 1
    Last Post: 05-10-2014, 05:15 PM
  3. Replies: 5
    Last Post: 12-12-2013, 08:51 PM
  4. [SOLVED] How to Clear default value from Textbox on click?
    By priya06manohar@gmail in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2013, 08:30 PM
  5. Default Double Click Clear macro
    By theghost in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2012, 11:20 AM
  6. Replies: 2
    Last Post: 11-17-2008, 09:14 PM
  7. Default directory change on click
    By clayton in forum Excel General
    Replies: 5
    Last Post: 08-13-2007, 02:43 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