Results 1 to 4 of 4

runtime error 1004 numberformat of range

Threaded View

  1. #1
    Registered User
    Join Date
    10-16-2014
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    2

    Exclamation runtime error 1004 numberformat of range

    Hi Excel Forum,

    I have just recently started learning about vba and macros.

    Currently, I am creating a macro to auto-input a date & time stamp(on a2) once another value has been placed on another cell(b2), with the help of a video from Youtube I am able to make the idea partly work.

    I am encountering an error: "runtime error 1004 numberformat of range"

    here is my macro(on "worksheet" & "change" dropdown):

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim i As Integer
    For i = 2 To 102
    If Cells(i, "B").Value <> "" Then
    
    Cells(i, "A").Value = Date & " " & Time
    Cells(i, "A").NumberFormat "m/d/yyyy h:mm"
    End If
    Next
    Range("A:A").EntireColumn.AutoFit
    End Sub

    Any corrections & suggestions to make my sheet work will be great!

    #Edit:

    By the way the sheet is unlocked.
    Last edited by alansidman; 10-24-2014 at 11:16 AM. Reason: Additional Info

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  2. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  3. Range - Runtime Error 1004
    By punter1000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2011, 11:33 PM
  4. Runtime Error '1004' At Range Selection
    By Anubeon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2009, 10:47 AM
  5. Runtime Error 1004 on selecting range
    By MaltzMD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2005, 11:05 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