Hello all,
I have been trying all afternoon to get something working and I can't figure out how to do this....
I am using the following to find the last used column in row 2 on my work sheet:
LastColumn = Sheets("Summary").Cells(2, Sheets("Summary").Columns.Count).End(xlToLeft).Column
I want to find the value in row 1 of this column and compare it to a value in another worksheet. I can't quite figure out how to accomplish this. I have been "Playing around" with the following:
Rng = Sheets("Summary").Cells(1, LastColumn - 1).Value
If Sheets("qryAccessExport").Range("A2") = Rng.Offset(-1, 0).Value Then
MsgBox "You have already copied this data over.", vbInformation + vbOKOnly
Exit Sub
End If
I don't know if I am on the right track or not. I am trying to automate a spreadsheet for bring in data on a monthly basis from an Access database.
Any help or pointing me in the right direction would be appreciated. Thank you!
I have been trying all afternoon to get something working and I can't figure out how to do this....
I am using the following to find the last used column in row 2 on my work sheet:
LastColumn = Sheets("Summary").Cells(2, Sheets("Summary").Columns.Count).End(xlToLeft).Column
I want to find the value in row 1 of this column and compare it to a value in another worksheet. I can't quite figure out how to accomplish this. I have been "Playing around" with the following:
Rng = Sheets("Summary").Cells(1, LastColumn - 1).Value
If Sheets("qryAccessExport").Range("A2") = Rng.Offset(-1, 0).Value Then
MsgBox "You have already copied this data over.", vbInformation + vbOKOnly
Exit Sub
End If
I don't know if I am on the right track or not. I am trying to automate a spreadsheet for bring in data on a monthly basis from an Access database.
Any help or pointing me in the right direction would be appreciated. Thank you!