Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    work with sheet hided.... (2000 sr 1)

    Please test and correct this part of code because go in error!!!;-(
    In effect i want use the range in sheet TEMPLATE witouth open it...

    Dim WS As Worksheet

    Set WS = Worksheets("TEMPLATE")

    With WS
    ULTIMA = Worksheets("TEMPLATE").Cells(Rows.COUNT, "A").End(xlUp).Row '+ 1
    Sheets("TEMPLATE").Range("A1:N" & ULTIMA).Select
    End With

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: work with sheet hided.... (2000 sr 1)

    You use

    With WS

    End With

    but you don't do anything with WS in between.

    You cannot select cells on a sheet that is not the active sheet. Instead, do something with the range.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: work with sheet hided.... (2000 sr 1)

    ... Ok solved first part, but i want to copy this range, please correct line...
    Set RNG_TEMPLATE = WS.Range("A1:N" & ULTIMA).Selection.Copy

    attached complete code

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: work with sheet hided.... (2000 sr 1)

    That line doesn't make sense. Please explain what you want to do. It is not clear from the code you posted, for you don't do anything with RNG_TEMPLATE or with Source.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: work with sheet hided.... (2000 sr 1)

    i want to copy from a hided sheet TEMPLATE the range WS.Range("A1:N" & ULTIMA) and use in Set Source = RNG_TEMPLATE for pasting in email with RangetoHTML

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: work with sheet hided.... (2000 sr 1)

    Where is the variable Source defined?

    You don't use the variable Source in RangeToHTML.

    Perhaps you should ask this to the person you got this code from.

Posting Permissions

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