Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Selecting Ranges

I want to select the following range:

Range("BW2:CF2").Select

However, I want to be able to change the 2 to a different number
programmatically using i as the variable.

I've tried

Range("BW"&i ":CF"&i).Select

and it just doesn't work. What am I doing wrong?

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Selecting Ranges

You are missing one "&"

Range("BW" & i & ":CF" & i).Select
--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

I want to select the following range:

Range("BW2:CF2").Select

However, I want to be able to change the 2 to a different number
programmatically using i as the variable.

I've tried

Range("BW"&i ":CF"&i).Select

and it just doesn't work. What am I doing wrong?

Thanks,
Barb Reinhardt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Selecting Ranges

I looked and looked for that. Don't ask me why I missed it.

Thanks! I knew someone here would find it quickly.

"Jim Thomlinson" wrote:

You are missing one "&"

Range("BW" & i & ":CF" & i).Select
--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

I want to select the following range:

Range("BW2:CF2").Select

However, I want to be able to change the 2 to a different number
programmatically using i as the variable.

I've tried

Range("BW"&i ":CF"&i).Select

and it just doesn't work. What am I doing wrong?

Thanks,
Barb Reinhardt

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Selecting Ranges

Barb

close ... try:

Range("BW" & i & ":CF" & i).Select

or

Range(Cells(i, "BW"), Cells(i, "CF")).Select

Regards

Trevor


"Barb Reinhardt" wrote in message
...
I want to select the following range:

Range("BW2:CF2").Select

However, I want to be able to change the 2 to a different number
programmatically using i as the variable.

I've tried

Range("BW"&i ":CF"&i).Select

and it just doesn't work. What am I doing wrong?

Thanks,
Barb Reinhardt



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 ranges Steve Wood Excel Programming 1 August 24th 04 02:16 PM
Selecting ranges with a text box Bob Metzler Excel Programming 0 September 22nd 03 04:47 PM
Selecting ranges with a text box Ed[_13_] Excel Programming 1 September 22nd 03 04:47 PM
Selecting Named Ranges Ian[_8_] Excel Programming 7 September 22nd 03 03:32 PM
selecting ranges MDC Excel Programming 1 July 24th 03 03:34 PM


All times are GMT +1. The time now is 11:32 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"