Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Selecting a Range Of Cells.

Can I select a range of cells programatically without knowing exactly which
ones they are?

I have a sheet that has a variable number of rows and columns, my code
searches all cells for a certain condition, and when the condition is met, it
needs to select that cell, and the next 8 cells in the same row in order to
copy and paste them somewhere else.

I've tried to use the line: (and various derivatives)

Selection.Offset(0, 8).Select

But this doesn't work.

Can anyone tell me what I'm doing wrong?

Thanks

Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selecting a Range Of Cells.

Try

Selection.Resize(1,8).Select

--

HTH

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


"Neil" wrote in message
...
Can I select a range of cells programatically without knowing exactly

which
ones they are?

I have a sheet that has a variable number of rows and columns, my code
searches all cells for a certain condition, and when the condition is met,

it
needs to select that cell, and the next 8 cells in the same row in order

to
copy and paste them somewhere else.

I've tried to use the line: (and various derivatives)

Selection.Offset(0, 8).Select

But this doesn't work.

Can anyone tell me what I'm doing wrong?

Thanks

Neil



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
Selecting a range of cells, how to ? Luc Excel Worksheet Functions 2 February 23rd 07 07:17 PM
Range selecting cells Alec H Excel Discussion (Misc queries) 2 March 14th 06 01:36 PM
Help with selecting a range of cells Mick[_3_] Excel Programming 0 January 12th 05 09:41 AM
Selecting a Range of cells in VBA spacecityguy[_4_] Excel Programming 3 August 30th 04 04:14 PM
Selecting a range of cells Kevin Excel Programming 5 October 10th 03 03:03 PM


All times are GMT +1. The time now is 05:59 PM.

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"