opaquefruitcake
New Member
- Joined
- Jan 6, 2019
- Messages
- 2
Hey,
I'm writing a program in vba for work that I want to take the data from each row in columns a and b, then combine that information into a string variable that's part of an array, then check to see whether that same combination appears again. At the moment I'm having trouble with creating and assigning the variable into an array. Here's whag I have so far:
Private Sub strtButton_Click
Dim lastRow As Integer
Dim i As Long
Dim fullValue() As String
lastRow = Cells(Rows.Count, 1).End(x1Up).row
For i = 1 To lastRow
fullValue(i) = ThisWorkbook.Sheets(Sheet1).Range("A" & i & "B" & i)
Next i
I was planning to maybe use the match function after this to test each variable against each other and then change the color of the row those numbers appear in depending on the result. I figured that since i should advance in the same orders of the rows I could use that to identify what is what down the line. Currently I cannot get past the initial loop to assign everything. I'm new to vba and excel so I apoligize if this whole idea is completely crazy. Thanks in advance for sny insight you may be able to offer.
I'm writing a program in vba for work that I want to take the data from each row in columns a and b, then combine that information into a string variable that's part of an array, then check to see whether that same combination appears again. At the moment I'm having trouble with creating and assigning the variable into an array. Here's whag I have so far:
Private Sub strtButton_Click
Dim lastRow As Integer
Dim i As Long
Dim fullValue() As String
lastRow = Cells(Rows.Count, 1).End(x1Up).row
For i = 1 To lastRow
fullValue(i) = ThisWorkbook.Sheets(Sheet1).Range("A" & i & "B" & i)
Next i
I was planning to maybe use the match function after this to test each variable against each other and then change the color of the row those numbers appear in depending on the result. I figured that since i should advance in the same orders of the rows I could use that to identify what is what down the line. Currently I cannot get past the initial loop to assign everything. I'm new to vba and excel so I apoligize if this whole idea is completely crazy. Thanks in advance for sny insight you may be able to offer.