Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Question about cell adressing

Folks,

I found a way to speed up my macro to select my data range by just
locating the first cell and then using count to count the used cells...

Now what I have is:
D
1 $D$17 (which is the start address)
2 623 (which is the amount of used cells)


So my data range is from $D$17 to $D$640.

Now I need to add 623 to the $D$17 in cell D2.

The formula would look like that Cell(D3)=($D$[a+b]).

Where a=17 (from $D$17)
b=623 (the value from D2!).


How does it need to be coded so that excel puts

$D$640 (doesnt need the $) in lets say, D3?

Thanks :)

Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Question about cell adressing

see if this is what you want
=ROW(INDIRECT(D1))+D2

--


Gary


"Matt" wrote in message
oups.com...
Folks,

I found a way to speed up my macro to select my data range by just
locating the first cell and then using count to count the used cells...

Now what I have is:
D
1 $D$17 (which is the start address)
2 623 (which is the amount of used cells)


So my data range is from $D$17 to $D$640.

Now I need to add 623 to the $D$17 in cell D2.

The formula would look like that Cell(D3)=($D$[a+b]).

Where a=17 (from $D$17)
b=623 (the value from D2!).


How does it need to be coded so that excel puts

$D$640 (doesnt need the $) in lets say, D3?

Thanks :)

Matt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Question about cell adressing

with activesheet
.range("d3").value _
= .range(.range("d1").value).offset(.range("d2").val ue).address(0,0)
end with


but I think you have a difference of 1 in your count. D17:D640 is really 624
cells.

if you care...

with activesheet
.range("d3").value _
= .range(.range("d1").value).offset(.range("d2").val ue-1).address(0,0)
end with

Matt wrote:

Folks,

I found a way to speed up my macro to select my data range by just
locating the first cell and then using count to count the used cells...

Now what I have is:
D
1 $D$17 (which is the start address)
2 623 (which is the amount of used cells)

So my data range is from $D$17 to $D$640.

Now I need to add 623 to the $D$17 in cell D2.

The formula would look like that Cell(D3)=($D$[a+b]).

Where a=17 (from $D$17)
b=623 (the value from D2!).

How does it need to be coded so that excel puts

$D$640 (doesnt need the $) in lets say, D3?

Thanks :)

Matt


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Question about cell adressing

Dave, Gary,

thanks for the help! Will test it soon :)

Matt

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
Conditional Formatting question (if cell = 0, wrap cell in quotes) Mo2 New Users to Excel 6 May 11th 07 11:06 PM
Adressing Jacek Excel Programming 1 June 30th 04 12:08 PM
Cell Question alexm999[_35_] Excel Programming 16 February 18th 04 03:45 PM
Question in a function cell to cell keawee Excel Programming 2 September 30th 03 02:25 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 03:39 PM.

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"