+ Reply to Thread
Results 1 to 3 of 3

Making date appear in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    54

    Making date appear in a cell

    So with everybodys help on here and a lot of research I have a macro that copies and pastes numbers from one sheet to another and then if there are any duplicates it removes them. It also looks through the numbers that are already on the second sheet and if the are not on the first sheet it dates a cell. Now this is pretty much what I need except one step further, when the number is brought to the second sheet I need it to date a cell. I have to following code already

    Sub Udpate()
    '
    ' Update Macro
    ' Keyboard Shortcut: Ctrl Shift + U
    '
    Dim lst As Long
    Sheets("Input").Range("B2:C51").Copy
    With Sheets("Sheet1")
        lst = .Range("A" & Rows.Count).End(xlUp).Row + 1
        .Range("A" & lst).PasteSpecial xlPasteValues
    End With
    
    
    Dim x  As Long
        Dim LastRow As Long
         
        LastRow = Range("B65536").End(xlUp).Row
        For x = LastRow To 1 Step -1
            If Application.WorksheetFunction.CountIf(Range("A2:A" & x), Range("A" & x).Text) > 1 Then
                Range("A" & x).EntireRow.Delete
            End If
        Next x
        
    Dim ws1 As Worksheet:   Set ws1 = Sheets("Sheet1")
    Dim ws2 As Worksheet:   Set ws2 = Sheets("Input")
    Dim Range1 As Range, Range2 As Range, icell As Range, iFind As Range
    
    Set Range1 = ws1.Range("A2:A" & ws1.Range("A" & Rows.Count).End(xlUp).Row)
    Set Range2 = ws2.Range("B2:B" & ws2.Range("B" & Rows.Count).End(xlUp).Row)
    
    For Each icell In Range1
        If IsNumeric(icell.Value) Then
            Set iFind = Range2.Find(What:=icell.Value, LookIn:=xlValues, lookat:=xlWhole)
                If iFind Is Nothing Then
                    icell.Offset(0, 3).Value = Date
                End If
        End If
    Next icell
    
    End Sub
    I would imagine it is just adding another line to the top function but I can not figure it out
    Last edited by wjk221; 11-27-2013 at 08:38 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,972

    Re: Making date appear in a cell

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    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



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-15-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Making date appear in a cell

    Sorry about that but I did fix it

+ 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] making dropdown list wider without making cell wider ???
    By wayneg in forum Excel General
    Replies: 16
    Last Post: 05-20-2021, 12:53 AM
  2. [SOLVED] Making date projections..
    By PWinkz in forum Excel General
    Replies: 6
    Last Post: 02-27-2013, 09:53 AM
  3. [SOLVED] Making a cell give the date the fist monday of the month
    By frankday in forum Excel General
    Replies: 10
    Last Post: 09-30-2012, 06:53 PM
  4. Always making the date the previous sunday.
    By Rgaherty in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-17-2007, 09:14 PM
  5. [SOLVED] Making a auto date entered into a cell permanent from a template
    By Muncher in forum Excel General
    Replies: 2
    Last Post: 05-26-2005, 06:10 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