I am running Excel 2007.
I want to modify the code below to select one "less" row and cannot figure out how to do it. Can anyone help me?
I have a small table that depending on the week ranges between 2-18 rows deep. NOTE: I have another table starting on row 21 so the "End(xlUp) statement starts on Row 20).
Please click on the link below to see a picture of the current table (.jpg format):
https://docs.google.com/leaf?id=0B8ZFmctoHTEBNDNhNmE5NWQtNzUxZS00Mzc0LTk5YTctOTkzNzI4YTEyNzZh&sort=name&layout=list&num=50. (Sorry, I do not have any server space available, so I am using Google Docs to store the picture).
Here is the situation: I am only want to select the rows and columns A4:A9 (not selecting the Grand Total row or column)
My current code only will select "all the rows and the first four columns, but I want to eliminate the last row from the selection. (I will using the "BeginCell, EndCell ranges to create a chart later in the code). Here is my current code:
Thank you,
Charles
I want to modify the code below to select one "less" row and cannot figure out how to do it. Can anyone help me?
I have a small table that depending on the week ranges between 2-18 rows deep. NOTE: I have another table starting on row 21 so the "End(xlUp) statement starts on Row 20).
Please click on the link below to see a picture of the current table (.jpg format):
https://docs.google.com/leaf?id=0B8ZFmctoHTEBNDNhNmE5NWQtNzUxZS00Mzc0LTk5YTctOTkzNzI4YTEyNzZh&sort=name&layout=list&num=50. (Sorry, I do not have any server space available, so I am using Google Docs to store the picture).
Here is the situation: I am only want to select the rows and columns A4:A9 (not selecting the Grand Total row or column)
My current code only will select "all the rows and the first four columns, but I want to eliminate the last row from the selection. (I will using the "BeginCell, EndCell ranges to create a chart later in the code). Here is my current code:
Code:
If Cells(4, 1).Value = "DefectDescription" Then
Set BeginCell = Cells(4, 1)
Set EndCell = Cells(20, 4).End(xlUp) [COLOR="Red"]'<---- I think this is where I need to subtract the row, but I do not know how! Am I wrong?[/COLOR]
Range(BeginCell, EndCell).Select
End If
Sheets("232 Charts").Select
Range("A3").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("232 Data").Range(BeginCell, EndCell), PlotBy _
:=xlRows
Thank you,
Charles