Matching Worksheets

Darren Smith

Active Member
Joined
Nov 23, 2020
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
Hi all

Trying to match worksheets see below. Can`t make it work??

VBA Code:
If ListBox4 = "Fills Job Card Master Sheet into Time Analysis Sheet" Then

   Dim Ary As Variant, Nary As Variant
   Dim wsDest As Worksheet
   Set wsDest = Worksheets("Job Card with Time Analysis")
   Dim rng As Range
   Set rng = wsDest.Range("A10:N")
   Dim Dic As Object
   Dim l As Long
  
   Set Dic = CreateObject("scripting.dictionary")

   With Sheets("Job Card Master")
   
      Ary = .Range("A10", .Range("A" & Rows.Count).End(xlUp)).Value2
      Nary = .Range("A10:N" & .Range("A" & Rows.Count).End(xlUp).Row).Value2
   End With
  
   With Sheets("Job Card with Time Analysis")
   
      For Each rng In .Range("A10", .Range("A" & Rows.Count).End(xlUp))
         Dic(rng.Value) = Empty
      Next rng
   End With
   For l = 1 To UBound(Ary)
      If Dic.Exists(Ary(r, 1)) Then Nary(r, 1) = "Yes"
   Next l
   Sheets("Job Card Master").Range("A10").Resize(UBound(Nary)).Value = Nary
   
   End If
   
End Sub
 

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.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,817
Office Version
  1. 365
Platform
  1. Windows
Rather than posting code that doesn't work, with no explanation of what's wrong. You would be better off explaining what you are trying to do.
 

Darren Smith

Active Member
Joined
Nov 23, 2020
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
I am trying to match the data from the worksheet to the new worksheet (In the same workbook) from Range A10 to N down to the bottom of the worksheets.
Trust that makes sense?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,817
Office Version
  1. 365
Platform
  1. Windows
Trust that makes sense?
No, fraid not.
Do you need to compare every cell, or just one column?
What do you want to do if they match & what do you want to do if they don't?

Please remember that whilst you have an intimate knowledge of your data & what you want to do, we do not.
You need to give clear & precise details.
 

Darren Smith

Active Member
Joined
Nov 23, 2020
Messages
419
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

No, fraid not.
Do you need to compare every cell, or just one column? All cells in the range A10 to N to bottom of worksheet
What do you want to do if they match & what do you want to do if they don't? All cells in the range need to match so what you write in Job Card Master Sheet fills the Job Card with Time Analysis Sheet in
automatically


Please remember that whilst you have an intimate knowledge of your data & what you want to do, we do not.
You need to give clear & precise details. Ok sorry
Is that any better see above
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,817
Office Version
  1. 365
Platform
  1. Windows
No fraid not.
You have not said what should happen if they match & what should happen if they don't.
 

Darren Smith

Active Member
Joined
Nov 23, 2020
Messages
419
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

No fraid not.
You have not said what should happen if they match & what should happen if they don't. If they match then they stay the same. If not leave blank
Here you are
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,817
Office Version
  1. 365
Platform
  1. Windows
Do NOT put your replies inside the quote, it looks as though you have not replied.
Did you actually read & understand this?
Please remember that whilst you have an intimate knowledge of your data & what you want to do, we do not.
You need to give clear & precise details.
I ask because you have so far totally ignored it. I cannot help you if you do not help me.
 

Darren Smith

Active Member
Joined
Nov 23, 2020
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
I assure you I am not ignoring you.
I was trying to say that if cells in the range match then they are to stay. If they are different then leave cells blank
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,817
Office Version
  1. 365
Platform
  1. Windows
What do you mean leave them blank? Do you clear them? If so in which sheet?
You have so far given very very general answers when I have asked you to be specific.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,083
Messages
5,639,980
Members
417,121
Latest member
DallyDally

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
Top