Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]() Hi, I'm trying to design a simple spreadsheet that does some accounting calculation and then represents them in a variety of charts. I'm simply using macros through demonstration rather than coding. I was wondering how one might be able to use VBA to detect the bottom right most range Y coordinate(X letter is predertimed - number of fields in spreadsheet) so the macro will run correctly regardless of how many rows there are? Thanks ahead, Altein -- altein |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Here is some code to give the limits of UsedRange:
Set r = ActiveSheet.UsedRange nLastRow = r.Rows.Count + r.Row - 1 MsgBox ("last row " & nLastRow) nLastColumn = r.Columns.Count + r.Column - 1 MsgBox ("last column " & nLastColumn) nFirstRow = r.Row MsgBox ("first row " & nFirstRow) nFirstColumn = r.Column MsgBox ("first column " & nFirstColumn) numrow = r.Rows.Count MsgBox ("number of rows " & numrow) numcol = r.Columns.Count MsgBox ("number of columns " & numcol) -- Gary''s Student - gsnu2007d "altein" wrote: Hi, I'm trying to design a simple spreadsheet that does some accounting calculation and then represents them in a variety of charts. I'm simply using macros through demonstration rather than coding. I was wondering how one might be able to use VBA to detect the bottom right most range Y coordinate(X letter is predertimed - number of fields in spreadsheet) so the macro will run correctly regardless of how many rows there are? Thanks ahead, Altein -- altein |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Detecting text and returning a value | Excel Discussion (Misc queries) | |||
detecting proxy settings | Excel Discussion (Misc queries) | |||
Detecting Oldest Date On Spreadsheet | Excel Discussion (Misc queries) | |||
Detecting absentees | Excel Discussion (Misc queries) | |||
Detecting a color | Excel Worksheet Functions |