Good afternoon and happy new year.
I am new here. Let's see if you can help me with a problem I have.
I have developed a function where I use find to find the cell that corresponds to today's date. However, it gives me an error 1004 that I don't know why it happens.
This is the function:
This sheet is a summary of hours by tasks, and to avoid having to stop each month to add a new month, copying a row, looking for which cells I have to expand the range ... what I do is automate it.
Also, and this is where I think the problem is, is that I have created custom formulas to calculate the data that I need to have, hence why you see so many functions in the VBA project. You can see it in the purple cells.
Let's see, the problem is solved as I indicate, adding an error control, capturing the 1004, and doing nothing. But I want to know why it gives this error, in case it could affect something else that I have on the sheet.
I also enclose the book so that you can see the best procedure. You just have to click on the button on the right above and it will give you the error.
Thank you!
I am new here. Let's see if you can help me with a problem I have.
I have developed a function where I use find to find the cell that corresponds to today's date. However, it gives me an error 1004 that I don't know why it happens.
This is the function:
VBA Code:
Function HorasDedicadasMesActual() As Date
Application.Volatile
On Error GoTo err_lbl
Dim Valor As Date
Valor = Cells(Range("A:A").Find(Format(Date, "mmmm-yy"), LookIn:=xlValues).Row, 2)
HorasDedicadasMesActual = Valor
err_Salida:
Exit Function
err_lbl:
Select Case Err.Number
Case 13
HorasDedicadasMesActual = 0
Case 91
HorasDedicadasMesActual = 1
'Case 1004 If I disable this, I get an error
Case Else
MsgBox Err.Number & " " & Err.Description & ActiveCell.Address
End Select
End Function
This sheet is a summary of hours by tasks, and to avoid having to stop each month to add a new month, copying a row, looking for which cells I have to expand the range ... what I do is automate it.
Also, and this is where I think the problem is, is that I have created custom formulas to calculate the data that I need to have, hence why you see so many functions in the VBA project. You can see it in the purple cells.
Let's see, the problem is solved as I indicate, adding an error control, capturing the 1004, and doing nothing. But I want to know why it gives this error, in case it could affect something else that I have on the sheet.
I also enclose the book so that you can see the best procedure. You just have to click on the button on the right above and it will give you the error.
Dropbox - File Deleted - Simplify your life
www.dropbox.com
Thank you!