+ Reply to Thread
Results 1 to 2 of 2

place content of variable in destined cell in previous worksheet

  1. #1
    sverre
    Guest

    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

  2. #2
    Gary Brown
    Guest

    RE: place content of variable in destined cell in previous worksheet

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

    --
    HTH,
    Gary Brown
    [email protected]
    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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1