Comparing and moving data between sheets in a workbook

VinnyP

New Member
Joined
May 29, 2015
Messages
1
I'm trying to compare two columns in different worksheets and when I hit a match, move other data columns in the matching row back to the other sheet.
First problem: I can't seem to see any "value" in the code window when I mouse over it. I'm guessing there is a problem with having both sheets active at the same time? Any suggestions would be greatly appreciated.

I'm running Windows 8.1 and Excel 2013 (Office 365 version) on a Core i5 machine with 32GB of memory.

I'm not sure how to post or attach a copy of the sheets I'm using... everything I've tried doesn't seem to work (PrtScr, Snipping Tool, JPG, attachments), so if you'd like to see it, please let me know how to go about that as well.

The code I've written is below (marked with * doesn't seem to work - .Value doesn't show anything when moused over):

Worksheets(Array("Standings", "Data")).Select
Do Until PlayerNum > 24
Select Case StandingsRow
Case 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33
PlayerA = True
Case Else
PlayerA = False
End Select
* If Worksheets("Data").Range("AG1").Offset(PlayerNum, 0).Value = _
* Worksheets("Standings").Range("B5").Offset(StandingsRow, 0).Value Then
* NameMatch = True
* Else
* StandingsRow = StandingsRow + 1
* End If
If NameMatch Then
* Worksheets("Standings").Range("c5").Offset(StandingsRow, 0).Value = _
* Worksheets("Data").Range("z1").Offset(PlayerNum, 0)
* Worksheets("Standings").Range("g5").Offset(StandingsRow, 0).Value = _
* Worksheets("Data").Range("aa1").Offset(PlayerNum, 0)
If PlayerA Then
* Worksheets("Standings").Range("h5").Offset(StandingsRow, 0).Value = _
* Worksheets("Data").Range("ae1").Offset(PlayerNum, 0)
End If
NameMatch = False
StandingsRow = 0
PlayerNum = PlayerNum + 1
Else
StandingsRow = StandingsRow + 1
End If
Loop


Hopefully, this makes some sort of sense. If not, let me know and I'll try to explain further.

Thanks very much in advance,

Vinny
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,203,529
Messages
6,055,933
Members
444,836
Latest member
nVaNL

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