Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / February 2007

Tip: Looking for answers? Try searching our database.

Selecting a Range with a Variable in VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ClinicITguy1 - 20 Feb 2007 18:14 GMT
Hello All,
I am trying to update a macro.  I know that I can select an individual cell
using a variable by using the Cells property.  I simply insert the variable
into the parameter as an index number for a row or column.  However, if I
want to work with a range of cells, there is no way to pass a variable into
the Range property.

I'm sure this is a basic quesiton for you programmers out there.  Can
someone please drop me a dime?
JE McGimpsey - 20 Feb 2007 18:24 GMT
I've read this a few times now, and have only the vaguest idea of what
you're trying to do, so this may be completely off target:

Perhaps

   Dim nRows As Long
   Dim nCols As Long
   Dim nStartRow As Long
   Dim nStartCol As Long

   ActiveSheet.Cells(nStartRow, nStartCol).Resize(nRows, nCols).Select

???

> Hello All,
> I am trying to update a macro.  I know that I can select an individual cell
[quoted text clipped - 5 lines]
> I'm sure this is a basic quesiton for you programmers out there.  Can
> someone please drop me a dime?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.