+ Reply to Thread
Results 1 to 2 of 2

Change cells in code to my selected cell

  1. #1
    Registered User
    Join Date
    05-11-2018
    Location
    Cincinnati, OH
    MS-Off Ver
    365
    Posts
    5

    Change cells in code to my selected cell

    Hi, I have some code I am trying to modify but struggling to understand how the selection and activate commands need to programmed to select the cell I just clicked on. I have a userform that inputs some text, and the code formats the cells a specific way. Right now, its set to output the results into cell D44. How do I modify this to output the results into any cell I have selected and not default to D44? It is more of a data entry into the cell I have selected. Thanks in advance!



    Private Sub CommandButton1_Click()

    Sheet1.Range("D44") = "={" & TextBox1.Value & "," & TextBox2.Value & "," & TextBox3.Value & "}"
    Unload Me
    End

    End Sub

  2. #2
    Forum Contributor
    Join Date
    05-12-2018
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    266

    Re: Change cells in code to my selected cell

    ActiveCell.value = ........

+ 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. Change Selected Cell Colour ...only whilst selected
    By mrgrotey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2017, 07:40 AM
  2. [SOLVED] When a cell is selected, change value of 2 other cells
    By Wishdom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2017, 11:40 PM
  3. [SOLVED] Change text color of selected cells based on a text value of another cell
    By JNEWBURY2280 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2014, 11:26 PM
  4. [SOLVED] VBA Code Change Event Code When 2 cells are selected
    By bjnockle in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-16-2014, 06:08 PM
  5. Replies: 1
    Last Post: 02-19-2013, 04:30 PM
  6. Code to change color and value in calendar cells based on selected dates
    By John74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2010, 02:01 PM
  7. Copy selected cells, then change to absolute cell reference
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2009, 03:15 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