ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   place content of variable in destined cell in previous worksheet (https://www.excelbanter.com/excel-programming/369865-place-content-variable-destined-cell-previous-worksheet.html)

sverre

place content of variable in destined cell in previous worksheet
 
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

Gary Brown

place content of variable in destined cell in previous worksheet
 
Try...
Cells(x, 3).value = res

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"sverre" wrote:

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



All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com