xlUp Problem
xlUp Problem
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: xlUp Problem

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I'm having a little issue with the xlUp code. My macro downloads data from an As/400 system. I then add a chart selecting all data in column B as data source starting at B2 to the end of the data. The data in column B ends at B10, when I try the xlup command, it stops at B13 which is empty. I have tried adding code to the macro deleting all rows between B10 and B13, still the xlUp stops at B13. I don't know if anyone has any ideas but I'm at a dead loss.

    Cheers

    Matt

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Newcastle, UK
    Posts
    1,174
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I doubt I can help you with this one BUT I'd post the code you have for anyone to see
    "Have a good time......all the time"
    Ian Mac

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here's the relevant code that I'm using, the data ends at B10 but for some reason the last row is being set at B13. Hope someone can help.


    Dim lastrow As Integer

    lastrow = Range("b65536").End(xlUp).Row

    Sheets("Sheet1").Select

    Charts.Add
    ActiveChart.ChartType = xl3DPieExploded
    ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B2:B" & lastrow), PlotBy:= _
    xlColumns

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Forget that post, sorry for wasting time, the lastrow was being set whilst looking over a different sheet. Have now moved the sheet select statement before setting lastrow.

    Apologies again

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com