Error

Juan C

Board Regular
Joined
Mar 6, 2009
Messages
131
Hello...

I have the following Macro:

Sub Datex()
dTime = Now + TimeValue("00:00:05")
Application.OnTime dTime, "Datex"
With Sheets("D 0-1")
If Now - Date >= TimeValue("00:00:00") And Now - Date <= TimeValue("17:00:00") Then
.Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).Value = .Range("A1").Value
.Cells(Rows.Count, "C").End(xlUp).Offset(1, 0).Value = .Range("A2").Value

End If
End With
End Sub

Every time I run it, I get the following message: The macro 'XX!Datex' cannot be found.

Any ideas on how to solve this...???

Thanks

JC
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Where did you put the code? It needs to go in a regular module (in the VBE Insert > Module).
 
Upvote 0
Macro this

Hello... Could somebody help me converting this formula:

=IF(J3>$A$2,0,LOOKUP(J3,$C$2:$C$4500,$B$2:$B$4500))

Into a macro....

Thanks

JC
 
Upvote 0
Re: Macro this

Put this in a Module:
Code:
Public Function MyFormula() As Variant
'   =IF(J3>$A$2,0,LOOKUP(J3,$C$2:$C$4500,$B$2:$B$4500))
    If Range("J3") > Range("A2") Then
        MyFormula = 0
    Else
        MyFormula = Application.WorksheetFunction.Lookup(Range("J3"), Range("C2:C4500"), Range("B2:B4500"))
    End If
End Function
 
Upvote 0
Re: Macro this

Thanks John... I got this error '1004':
Unable to get the Lookup property of the WorksheetFunction class

Any ideas???


Put this in a Module:
Code:
Public Function MyFormula() As Variant
'   =IF(J3>$A$2,0,LOOKUP(J3,$C$2:$C$4500,$B$2:$B$4500))
    If Range("J3") > Range("A2") Then
        MyFormula = 0
    Else
        MyFormula = Application.WorksheetFunction.Lookup(Range("J3"), Range("C2:C4500"), Range("B2:B4500"))
    End If
End Function
 
Upvote 0
Parabolic SAR

Hello all!!!

Does somebody know the formula (not a macro nor add in) to calculate a Parabolic SAR????

Thanks

JC
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,183
Members
448,872
Latest member
lcaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top