Runtime error '424' driving me nuts!!

JoanaMartins

New Member
Joined
Jul 14, 2016
Messages
29
Please, I so need your help!

The error appears when i do the set w thing!

I am kind of a beginner so can you kindly help me?

Code:
Sub Datas()

Dim w As Range
Dim t As Long
Dim i As Long




t = Sheets("Crono").Cells(Rows.Count, "A").End(xlUp).Row




For i = 8 To t


Set w = Sheets("Projetos NOVO").Range("C:C").Find(Sheets("Crono").Range("A" & i).Value).Row


If Sheets("Projetos NOVO").Range("D" & w).Find(Sheets("Crono").Range("C" & i).Value).Row Then


Sheets("Crono").Range("F" & i).Value = Sheets("Projetos NOVO").Range("R" & w).Value
Sheets("Crono").Range("G" & i).Value = Sheets("Projetos NOVO").Range("S" & w).Value


Else


End If


Next i


End Sub



Thank you in advance!
 
You can also specify the comparison method without using UCase:

Code:
If Instr(1, w.Offset(0, 1).Value, cs.Cells(i, 1).Value, vbTextCompare) > 0 Then

WBD
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
It works 90%.
I did not realize that there is not only one match for the first criteria.
What happens with the current code is that it finds the value on a cell and doesn't continue to look for others. it automatically goes to the next one.
 
Upvote 0

Forum statistics

Threads
1,215,348
Messages
6,124,425
Members
449,157
Latest member
mytux

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