Error

Juan C

Board Regular
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

VoG

Legend
Where did you put the code? It needs to go in a regular module (in the VBE Insert > Module).

Juan C

Board Regular
OK... thanks. It solved the isssue....

JC

Where did you put the code? It needs to go in a regular module (in the VBE Insert > Module).

Juan C

Board Regular
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

John_w

MrExcel MVP
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``````

Juan C

Board Regular
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``````

Juan C

Board Regular
Parabolic SAR

Hello all!!!

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

Thanks

JC

Replies
2
Views
235
Replies
2
Views
392
Replies
5
Views
310
Replies
1
Views
271
Replies
2
Views
134

1,190,809
Messages
5,983,040
Members
439,815
Latest member
yoswosz

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.

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

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