place content of variable in destined cell in previous worksheet

G

Guest

Hi

I get an error message in the line
Cells(x, 3).content = res

I want to place content of res in cellls (x,3) in previous worksheet

How do I do that??

Sub test()

Sheets("makro").Activate

ActiveSheet.Previous.Select

x = 5

Do While Cells(x, 3).Value <> ""

res = Application.vlookup(Cells(x, 3),
Worksheets("P&Ltot").Range("A1:G50000"), 7, False)
Cells(x, 3).content = res
x = x + 1

Loop



End Sub
 
G

Guest

Try...
Cells(x, 3).value = res

--
HTH,
Gary Brown
(e-mail address removed)
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
 

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