![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|