Good afternoon -
Spending some time today working on my VBA skills and struggling with two diensional arrays. Thanks in advance for any help.
Simply put, I'm trying to compare values in column A with values in a 2D array. When there is a match, I want to turn the value in column A to a bold font. Here's my code and attached is my practice workbook.
![]()
Sub Practice8() 'THE PURPOSE IS TO COMPARE THE VALUES IN COLUMN A WITH THE _ VALUES IN THE ARRAY (i.e., Sheet2, Range C1:D3) AND WHENEVER A _ MATCH IS FOUND, TURN THE VALUE IN COLUMN A TO BOLD Dim Arr() As Variant Arr = Range("C1:D3") Dim r As Long Dim c As Long With Sheet2 For r = 1 To UBound(Arr, 1) For c = 1 To UBound(Arr, 2) Next c Next r Dim i As Long Dim Rows As Long For i = 1 To 4 If Cells(i, 1) = (r) & (c) Then Cells.Font.Bold = True End If Next i End With End Sub
Bookmarks