Results 1 to 13 of 13

Highlight textbox if date <=60 days referencing an array as textbox numbers

Threaded View

nigelog Highlight textbox if date... 03-23-2017, 10:12 AM
cytop Re: Highlight textbox if date... 03-23-2017, 10:16 AM
nigelog Re: Highlight textbox if date... 03-23-2017, 10:20 AM
nigelog Re: Highlight textbox if date... 03-23-2017, 10:21 AM
bakerman2 Re: Highlight textbox if date... 03-23-2017, 10:18 AM
bakerman2 Re: Highlight textbox if date... 03-23-2017, 10:22 AM
nigelog Re: Highlight textbox if date... 03-23-2017, 10:44 AM
cytop Re: Highlight textbox if date... 03-23-2017, 11:04 AM
nigelog Re: Highlight textbox if date... 03-23-2017, 11:14 AM
bakerman2 Re: Highlight textbox if date... 03-23-2017, 11:16 AM
cytop Re: Highlight textbox if date... 03-23-2017, 11:31 AM
nigelog Re: Highlight textbox if date... 03-23-2017, 11:39 AM
bakerman2 Re: Highlight textbox if date... 03-23-2017, 11:43 AM
  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Highlight textbox if date <=60 days referencing an array as textbox numbers

    A dblclick event loads a userforms textboxes from 1 to 46

    textboxes 27,29,31,33,37,39 and 41 are expiry dates, I am trying to highlight these if due with 60 days

    I have tried various forms of this but just cant seem to be able to reference the array value only
    When I try using "For j =" a message box appears saying Expected "To"

       
     For j = Array(27, 29, 31, 33, 35, 37, 39, 41)
        If DateValue("Ddtxt_" & j).Value - Now() <= 60 Then
        Me("Ddtxt_" & j).BackColor = vbRed
        Next j
        End If
    Any pointers appreciated

    the code to load the userform is
        With DDlst_1
            For i = 0 To 46
                If i <> 19 Then
                    Me("Ddtxt_" & i + 1).Value = .List(.ListIndex, i)
                End If
            Next i
        End With
    Last edited by nigelog; 03-23-2017 at 11:40 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  2. [SOLVED] Type in TextBox after referencing a different Textbox
    By WAYNE005 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-05-2014, 06:50 PM
  3. highlight textbox when selected
    By lifeseeker1019 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2014, 07:33 PM
  4. Highlight Row from TextBox in Userform
    By lsteinbach in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2013, 05:07 PM
  5. Highlight text within a textbox
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-07-2009, 02:30 PM
  6. [SOLVED] Highlight the contain of textbox and radio button
    By Peter Cheang in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2006, 11:55 AM
  7. Highlight all Text in a Textbox when the textbox is selected
    By RPIJG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2005, 03:28 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