Looking at matching values in 2 sheets and using data from offset column to populate cells.

Mike Neal

New Member
Joined
May 24, 2020
Messages
38
Office Version
  1. 2013
Platform
  1. Windows
I have 2 sheets that each have a column for Task IDs. The first sheet is called PM Tasks and in column "A" I have Task IDs and in column "B" I have the frequency of the tasks to be performed. This is: "Weekly", "Monthly", etc. The second sheet is called "PM Schedule" on this sheet the Task IDs are in column "B". On the first sheet the Task ID is only listed once. It is my Master List of Tasks. The second sheet the Task ID's repeat because they are assigned to Machine IDs and one Task can be assigned to more than one machine. I am trying to lookup the Task ID on the first sheet and find the Frequency which is in Column B and add that Frequency to every occurrence of that Task in the second sheet in Column C. This is what I have so far but I get an error 438 "Object doesn't support this property or method."
In the line: Dic (Cl.value = Cl.Offset(, 1).value)

I would appreciate and help with this. Thank you.

Dim Cl As Range, Dic As Object

Set Dic = CreateObject("Scripting.dictionary")

With Sheets("PM Tasks")

For Each Cl In .Range("A3", .Range("A" & Rows.Count).End(xlUp))

Dic (Cl.value = Cl.Offset(, 1).value)

Next Cl

End With

With Sheets("PM Schedule")

For Each Cl In .Range("B3", .Range("B" & Rows.Count).End(xlUp))

If Dic.Exists(Cl.value) Then Cl.Offset(, 1).value = Dic(Cl.value)

Next Cl

End With
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
It should be
VBA Code:
 Dic(Cl.value) = Cl.Offset(, 1).value
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,178
Members
448,871
Latest member
hengshankouniuniu

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