Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50167

Macros Error 1004

$
0
0
Let me start by saying I don't really have any idea what I'm doing with Macros. I'm somewhat excel savvy but this is a totally different ball game. I copy and pasted a formula from another thread from earlier and was really hoping I'd be able to use that method to achieve my end goal. My task is VERY simple. I just want to be able to click a cell and have a check box appear and the date and time appear next to it (I wanted the check and the date and time all in one cell, but hey beggars can't be choosers!). So for the first half of my day this formula was working:

PHP Code:

Option Explicit
Dim lrow 
As Long

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As RangeCancel As Boolean)
    
lrow Cells(Rows.Count1).End(xlDown).Row

    
If Target.Cells.Count 1 Then Exit Sub

        
If Not Intersect(TargetRange("B3:B" lrow)) Is Nothing Then

            Target
.Font.Name "Marlett"

                
If Target vbNullString Then

                    Target 
"b"

                
Else

                    
Target vbNullString

                End 
If

        
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If 
Not Intersect(TargetRange("B3:B" lrow)) Is Nothing Then
        
If Target.Value "b" Then
            Target
.Offset(01).Value Format(Now"dd/mm/yy,hh:mm")
        
End If
    
End If

End Sub 

However... I'm now getting this error:

error.PNG

I've attached the file so whoever is willing to take a crack at it can see what I'm shooting for. I appreciate the help!!

VBA Test.xlsm

Viewing all articles
Browse latest Browse all 50167

Trending Articles