Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Range issue...

Today you've answered several questions in regards to finding the end of a
column and assigning it to a variable. I've attempted to use the information
in these posts on the board and have been unable to make it work in my
instance.

I am doing some regression with the Analysis Toolpack and am trying to
program a macro that will automatically look at how long a column is an
assign that cell to a range.

For instance, in the code below, I'd like to replace the two statements
"ActiveSheet.Range("G6:G135")" as well as the one with the H6:H135 range with
two new statements that generally states "ActiveSheet.Range("G6:(last
occupied cell in each column")".

..
..
..
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G135"),
ActiveSheet.Range("H6:H135"), False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
..
..
..

Thank you greatly in advance for your help!

James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Range issue...

Hi,

Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G" &
Cells(Rows.Count, "G").End(xlUp).Row), _
ActiveSheet.Range("H6:H" & Cells(Rows.Count, "H").End(xlUp).Row), False,
True, , _
"Weibull-LineToTheData", False, False, False, True, , False

HTH

"James" wrote:

Today you've answered several questions in regards to finding the end of a
column and assigning it to a variable. I've attempted to use the information
in these posts on the board and have been unable to make it work in my
instance.

I am doing some regression with the Analysis Toolpack and am trying to
program a macro that will automatically look at how long a column is an
assign that cell to a range.

For instance, in the code below, I'd like to replace the two statements
"ActiveSheet.Range("G6:G135")" as well as the one with the H6:H135 range with
two new statements that generally states "ActiveSheet.Range("G6:(last
occupied cell in each column")".

.
.
.
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G135"),
ActiveSheet.Range("H6:H135"), False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
.
.
.

Thank you greatly in advance for your help!

James

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Range issue...

Thanks! Worked like a charm!

"Toppers" wrote:

Hi,

Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G" &
Cells(Rows.Count, "G").End(xlUp).Row), _
ActiveSheet.Range("H6:H" & Cells(Rows.Count, "H").End(xlUp).Row), False,
True, , _
"Weibull-LineToTheData", False, False, False, True, , False

HTH

"James" wrote:

Today you've answered several questions in regards to finding the end of a
column and assigning it to a variable. I've attempted to use the information
in these posts on the board and have been unable to make it work in my
instance.

I am doing some regression with the Analysis Toolpack and am trying to
program a macro that will automatically look at how long a column is an
assign that cell to a range.

For instance, in the code below, I'd like to replace the two statements
"ActiveSheet.Range("G6:G135")" as well as the one with the H6:H135 range with
two new statements that generally states "ActiveSheet.Range("G6:(last
occupied cell in each column")".

.
.
.
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G135"),
ActiveSheet.Range("H6:H135"), False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
.
.
.

Thank you greatly in advance for your help!

James

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Range issue...

With ActiveSheet
Set rngG = .Range("G6:G" & .Cells(Rows.Count,"G").End(xlUp).Row)
Set rngH = .Range("H6:H" & .Cells(Rows.Count,"H").End(xlUp).Row)
Application.Run "ATPVBAEN.XLA!Regress", rngG,
.rngH,False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
End With



--

HTH

RP
(remove nothere from the email address if mailing direct)


"James" wrote in message
...
Today you've answered several questions in regards to finding the end of a
column and assigning it to a variable. I've attempted to use the

information
in these posts on the board and have been unable to make it work in my
instance.

I am doing some regression with the Analysis Toolpack and am trying to
program a macro that will automatically look at how long a column is an
assign that cell to a range.

For instance, in the code below, I'd like to replace the two statements
"ActiveSheet.Range("G6:G135")" as well as the one with the H6:H135 range

with
two new statements that generally states "ActiveSheet.Range("G6:(last
occupied cell in each column")".

.
.
.
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G135"),
ActiveSheet.Range("H6:H135"), False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
.
.
.

Thank you greatly in advance for your help!

James



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Range issue...

Thanks for the input!

"Bob Phillips" wrote:

With ActiveSheet
Set rngG = .Range("G6:G" & .Cells(Rows.Count,"G").End(xlUp).Row)
Set rngH = .Range("H6:H" & .Cells(Rows.Count,"H").End(xlUp).Row)
Application.Run "ATPVBAEN.XLA!Regress", rngG,
.rngH,False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
End With



--

HTH

RP
(remove nothere from the email address if mailing direct)


"James" wrote in message
...
Today you've answered several questions in regards to finding the end of a
column and assigning it to a variable. I've attempted to use the

information
in these posts on the board and have been unable to make it work in my
instance.

I am doing some regression with the Analysis Toolpack and am trying to
program a macro that will automatically look at how long a column is an
assign that cell to a range.

For instance, in the code below, I'd like to replace the two statements
"ActiveSheet.Range("G6:G135")" as well as the one with the H6:H135 range

with
two new statements that generally states "ActiveSheet.Range("G6:(last
occupied cell in each column")".

.
.
.
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("G6:G135"),
ActiveSheet.Range("H6:H135"), False, True, , _
"Weibull-LineToTheData", False, False, False, True, , False
.
.
.

Thank you greatly in advance for your help!

James






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple range selection issue SPV Excel Discussion (Misc queries) 1 June 27th 07 04:15 PM
I feel so dumb - please help - this is a Range issue Cat Excel Worksheet Functions 4 May 31st 07 11:48 PM
Names.Add - Range Syntax Issue Arturo Excel Programming 4 April 22nd 05 04:04 PM
Copy Range Issue SIGE Excel Programming 15 April 5th 05 04:57 PM
Excel Range issue Rohit Nayak Excel Programming 2 November 19th 04 03:10 PM


All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"