Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need to Select multiple cells based on counter

Hey,

I'm having trouble finding how to make a selection of cells usin
integer values rather than text

i.e.
Range("A1:A5")

Is there a way to use Range with integer values?
I need to make selections of cells based on an integer counter in a VB
Script

Thanks!!

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need to Select multiple cells based on counter

A couple of ways:

For only one column -

Range("A" & iFirstRow & ":A" & iLastRow)

where ifirstrow and ilastrow are the row range. Or-

Range(Cells(iFirstRow, iFirstCol), Cells(iLastRow, iLastCol))

to select from multiple contiguous rows and columns.



--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Need to Select multiple cells based on counter

You can use Cells

Sub test()
Range(Cells(1, 1), Cells(5, 1)).Select
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Skyron " wrote in message ...
Hey,

I'm having trouble finding how to make a selection of cells using
integer values rather than text

i.e.
Range("A1:A5")

Is there a way to use Range with integer values?
I need to make selections of cells based on an integer counter in a VBA
Script

Thanks!!!


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Need to Select multiple cells based on counter

I find it easier to use the Cells() object, something like

Cells(myrownumber, mycolumnnumber)

--
Regards

Juan Pablo González

"Skyron " wrote in message
...
Hey,

I'm having trouble finding how to make a selection of cells using
integer values rather than text

i.e.
Range("A1:A5")

Is there a way to use Range with integer values?
I need to make selections of cells based on an integer counter in a VBA
Script

Thanks!!!


---
Message posted from http://www.ExcelForum.com/



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
select value in table based on values entered in multiple cells claudard64 Excel Worksheet Functions 3 November 16th 08 12:05 PM
How do I Select Multiple Non Adjacent Rows based on a cell value? avalynch Excel Worksheet Functions 2 October 1st 06 07:45 PM
How to increase counter based on values in 2 different cells txlonghorn1989 Excel Worksheet Functions 5 June 23rd 06 12:57 PM
Is there a smart way to select multiple rows based on #2 :) Mike Excel Programming 2 May 1st 04 05:56 PM
Is there a smart way to select multiple rows based on column... Mike[_81_] Excel Programming 6 May 1st 04 12:51 PM


All times are GMT +1. The time now is 02:30 AM.

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

About Us

"It's about Microsoft Excel"