Juriemagic
New Member
hi there, this is a code I have:
I received this code from Paul_Hossler on MrExcel. (a Great Thanx to him), however this code does not execute. I am hoping that someone would be so kind to please have a look at this code to see why it refuses to work. I am uploading a sample file. Thank you all very much for your time spent on this..oops, I get an error when I try to upload..
Code:
Sub COPY_TO_SHEET_2()
MY_MATCH = Sheets("Sheet1").Range("C2").Value
MY_OTHERMATCH = Sheets("Sheet1").Range("C3").Value
MY_VALUE = Sheets("Sheet1").Range("C4").Value
With Sheets("Sheet2")
For MY_ROWS = 1 To .Range("B" & Rows.Count).End(xlUp).Row
If .Range("B" & MY_ROWS).Value = MY_MATCH Then
For MY_COLS = 3 To Cells(1, Columns.Count).End(xlToLeft).Column
If Cells(1, MY_COLS).Value = MY_OTHERMATCH.Value Then
Cells(MY_ROWS, MY_COLS).Value = MY_VALUE
Exit Sub
End If
Next MY_COLS
End If
Next MY_ROWS
End With
End Sub
I received this code from Paul_Hossler on MrExcel. (a Great Thanx to him), however this code does not execute. I am hoping that someone would be so kind to please have a look at this code to see why it refuses to work. I am uploading a sample file. Thank you all very much for your time spent on this..oops, I get an error when I try to upload..