+ Reply to Thread
Results 1 to 6 of 6

Fill any cell of excel with VBA Macro

  1. #1
    Registered User
    Join Date
    07-28-2020
    Location
    Ecuador
    MS-Off Ver
    2016
    Posts
    12

    Fill any cell of excel with VBA Macro

    Hi Guys, I'm glad to greet you again

    Please I need support for the following problem, I am still an amateur:

    I need a macro to fill, for example yellow, any excel cell. If the user clicks on a cell in the worksheet, he can perform this action.

    Thank you so much !!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Fill any cell of excel with VBA Macro

    Hi karlhyun94

    Welcome to the forum...
    Put this snippet in the Sheet Module...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    07-28-2020
    Location
    Ecuador
    MS-Off Ver
    2016
    Posts
    12

    Re: Fill any cell of excel with VBA Macro

    Hii, thank you so much for your fast answer, but I'd like to add this code to a button. How can I do that?

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Fill any cell of excel with VBA Macro

    So why...
    I need a macro to fill, for example yellow, any excel cell. If the user clicks on a cell in the worksheet
    Step 1, Enable the Macro Recorder: Click on the developer ribbon, then click on the record macro button: ...
    Step 2, Change the Fill Color of a Cell: Change the fill color of a cell to the desired color. ...
    Step 3, Stop the Macro Recorder: ...
    Go to the visual basics editor.

    And voilą!...There is your macro...

  5. #5
    Registered User
    Join Date
    07-28-2020
    Location
    Ecuador
    MS-Off Ver
    2016
    Posts
    12

    Re: Fill any cell of excel with VBA Macro

    Thank you, with your previous answer I was thinking how put that in a button and I resolved it

    The button looks like this, for example:

    Sub "title"()

    Dim cell As Range

    ActiveCell.Interior.Color = RGB(255, 153, 204)

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Fill any cell of excel with VBA Macro

    Well...look at that...You just wrote your first macro...
    To simplify
    Please Login or Register  to view this content.

+ 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 macro to fill cell with one click based on value from dropdown list
    By gorely84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2018, 02:03 PM
  2. [SOLVED] Macro to look at another cell, check for text and amend the fill of the current cell
    By ensanguined in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2017, 01:23 AM
  3. Create Macro to fill cell with text charters into cell that selected
    By jk3700 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2016, 09:58 PM
  4. Macro to fill cell based on another cell background color
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2016, 05:47 AM
  5. Macro to fill only when there's value in cell B
    By Kehjz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2015, 06:57 PM
  6. [SOLVED] Macro: Use cell fill color to determine if to copy & paste to another cell on the same row
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-19-2013, 09:50 AM
  7. Replies: 0
    Last Post: 04-06-2009, 04:07 PM

Tags for this Thread

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