#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default Range Usage

I need to be able to adjust the ending cell range in this example by using a
formula,for when I do an insert rows, the K76 will become K86 or anyother
number.What are my options and how do I construct this statement so that I
will not have to touch is statement again.

If Not Application.Intersect(Target, Me.Range("K4:K76")) Is Nothing Then
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Range Usage

I need to be able to adjust the ending cell range in this example by using
a
formula,for when I do an insert rows, the K76 will become K86 or anyother
number.What are my options and how do I construct this statement so that I
will not have to touch is statement again.

If Not Application.Intersect(Target, Me.Range("K4:K76")) Is Nothing Then


Put the 76 or 86 or whatever into a String variable and concatenate it into
the range text...

Dim ColNumber As String
.....
.....
ColNumber = "86"
.....
.....
If Not Application.Intersect(Target, Me.Range("K4:K" & ColNumber)) Is
Nothing Then
.....
.....

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default Range Usage

Thanks will give it a try.

"Rick Rothstein (MVP - VB)" wrote:

I need to be able to adjust the ending cell range in this example by using
a
formula,for when I do an insert rows, the K76 will become K86 or anyother
number.What are my options and how do I construct this statement so that I
will not have to touch is statement again.

If Not Application.Intersect(Target, Me.Range("K4:K76")) Is Nothing Then


Put the 76 or 86 or whatever into a String variable and concatenate it into
the range text...

Dim ColNumber As String
.....
.....
ColNumber = "86"
.....
.....
If Not Application.Intersect(Target, Me.Range("K4:K" & ColNumber)) Is
Nothing Then
.....
.....

Rick


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
Protect/Restrict usage of a range of cells. Sri Harsha[_2_] Excel Discussion (Misc queries) 2 February 24th 09 12:03 PM
range usage question jzingman Excel Worksheet Functions 6 January 10th 08 04:45 PM
Different usage of range formats, conflict? azzura Excel Programming 2 August 14th 06 03:49 AM
Dynamic range not resized for RowSource usage Tim Zych[_8_] Excel Programming 3 August 9th 04 02:08 AM
Variable usage in Range Command DavidC[_2_] Excel Programming 2 May 27th 04 03:51 AM


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