LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Trying to use cells as a variable to calculate(count) an array

Brett,
Something like this? It will select ROWS from Firstrow to
Lastrow

Sub GetRows()

Dim FirstCell As Range, LastCell As Range
Dim Firstrow As Long, Lastrow As Long

Do
Set FirstCell = Application.InputBox("Enter top left cell - ONE cell
only", Type:=8)
Loop Until FirstCell.Count = 1
Firstrow = FirstCell.Row

Do
Set LastCell = Application.InputBox("Enter bottom right cell - ONE cell
only", Type:=8)
Loop Until LastCell.Count = 1
Lastrow = LastCell.Row

MsgBox Firstrow & " " & Lastrow

Range(Firstrow & ":" & Lastrow).Select

End Sub


HTH

"Brett Smith" wrote:

I am trying to program a dialog box to ask for the first cell which would be
the upper most left cell. Then I am going to try to get a second reading
from a dialog box which a user would enter the lowest most right cell.
Afterwards I want to be able to calculate in my code how many times the
program would go through each line. Afterwards it would spit out a text file
of information taken from the excel file. I know it's easy to say if a
person from 1-1000, but how would I do this if a person selects from Cell A1
- Cell H1000? How would I be able to have my program read the cell number 1
and cell number 1000 without the A and the H? SO I guess I am asking how
would I have it select Range(1:1000) instead of Range(A1:H1000)?

 
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
how do i count text cells in excel based on variable criteria? anmaka57 Excel Worksheet Functions 2 January 26th 10 04:00 PM
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Concatenate Variable Array of Text Cells atryon Excel Discussion (Misc queries) 3 August 29th 08 11:57 PM
Count if array contains cells of a certain value Melissa Excel Worksheet Functions 2 July 29th 05 02:37 AM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM


All times are GMT +1. The time now is 08:21 PM.

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"