copy cell contents if "x" is present in cell.

G

Guest

I need help with some code.

I have a list of dealers in Column A.
In Column B is HireDate.
Column C - I has the heading of what game they deal (BJ,TCP,CRAPS,ect, ect.)
In Column C-I has "x" if they deal that particular game.
Column L-R has the same column heads (BJ,TCP,CRAPS, ect, ect.)

What I want:
If cell C3 has an "X" in the row (meaning if they deal that particular game
or not) If there is an "x" in c3 then copy a3 to L3.

Problem is that Dealers come and go (high turnover rate). If Cell A3 name
changes, and he doesn't deal BJ then there will be an empty cell in the
coresponding list of names (column L). I don't want to have any empty cells
in columns L-R.
I hope i have expained it properly. Thanks guys and gals.

Robb
 
C

Crowbar via OfficeKB.com

Dim LastRow
LastRow = Sheet1.UsedRange.Row - 1 + _
Sheet1.UsedRange.Rows.Count

For x = 1 to lastrow

If sheet1.cells(x, 3).value = "X" then
range("L" & x).value = range("A" & x).value
End If
Next x


Jste this not tested it but it should do what you want

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top