+ Reply to Thread
Results 1 to 2 of 2

VBA ActiveX ComboBox code to display today's date in corresponding column

  1. #1
    Registered User
    Join Date
    03-26-2021
    Location
    Laurel, Maryland
    MS-Off Ver
    2016
    Posts
    1

    VBA ActiveX ComboBox code to display today's date in corresponding column

    I have a list of numbers in column B. I created an ActiveX Combobox consisting of one of all the part numbers listed in column B. When I click on a part number in the Combobox, I would like to have today’s date appear on the same row as the part number in Column G. For example if I select number 3504 in the Combobox which happens to be in B14 and B28, then today’s date is automatically entered into G14 and G28. The code I currently have does not do anything when I click on a value in the ComboBox. I have included the code below. I am VERY new to VBA so I am not really sure what I’m doing.

    Private Sub ComboBox1_Change()
    Dim CellValue As Long
    Dim Worksheets As Worksheet
    Dim cell As Range
    For Each cell In Range("B10:B81")
    If CellValue = ComboBox1.Value Then
    Sheet11.Cells(cell, ColumnG).Value = Now()
    CellValue = CellValue + 1
    End If
    Next cell
    End Sub

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: VBA ActiveX ComboBox code to display today's date in corresponding column

    please see forum rules regarding code tags
    once this is done an easy answer will be possible.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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. Display an ID number if a date in column is today.
    By jbrooks1988 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-11-2019, 05:29 AM
  2. [SOLVED] activex combobox to trigger automatic sheet code
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-23-2016, 01:56 PM
  3. VBA code to ComboBox (ActiveX Control)
    By kasun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2014, 04:41 AM
  4. How to display the column containing today's date
    By Karenmh in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-28-2014, 10:23 AM
  5. Copy ActiveX ComboBox from One Sheet to Another and Then Have it Execute Code
    By mawalker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2013, 09:47 AM
  6. Activex combobox date format
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2012, 06:42 AM
  7. Code to change LinkedCell of ActiveX ComboBox
    By ozhunter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-08-2011, 07:10 AM

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