Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default keep on adding

my problem is the following.

Since I have a numerical integration method implemted in my excel
sheet I have a huge amount of rows containing data which I can find
the value I need with vertical lookup. However, I would like to give
it a go with VBA.

I want to work with little steps, which keeps on adding up "tt" till
the desired value.

tt = Range("A35")
dt = Range("B38")
xt = Range("35B")

If xt = xt Then tt = tt + dt

I tried the above. but he only does it once, and i want it to keep on
going. I´ve searched the web and hit help function. I guess I have to
use the Do..Loop function. Anyone who knows how to fix this.

It is cell A35 which have to ascent.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default keep on adding

I don't understand a few things--like range("35B") or what you're doing, but you
can use =vlookup() in your code:

Dim res as variant 'could return an error -- #n/a in a worksheet
dim TableRng as range
dim myVal as variant

with worksheets("sheet999")
set tablerng = .range("a1:x" & .cells(.rows.count,"A").end(xlup).row)
end with

myVal = "whatever you're matching on"

res = application.vlookup(myval, tablerng, 3, false)

if iserror(res) then
'not found
else
msgbox res
end if

Maybe it'll help?????

Robert wrote:

my problem is the following.

Since I have a numerical integration method implemted in my excel
sheet I have a huge amount of rows containing data which I can find
the value I need with vertical lookup. However, I would like to give
it a go with VBA.

I want to work with little steps, which keeps on adding up "tt" till
the desired value.

tt = Range("A35")
dt = Range("B38")
xt = Range("35B")

If xt = xt Then tt = tt + dt

I tried the above. but he only does it once, and i want it to keep on
going. I´ve searched the web and hit help function. I guess I have to
use the Do..Loop function. Anyone who knows how to fix this.

It is cell A35 which have to ascent.


--

Dave Peterson
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
Adding Dig Excel Discussion (Misc queries) 3 August 19th 08 12:35 AM
Just adding Learning Excel Excel Discussion (Misc queries) 4 October 27th 07 06:45 PM
Value NOT adding 1 ?? Corey Excel Programming 10 February 16th 07 03:27 PM
Adding an OR to SUM(IF.... JustMe602 Excel Worksheet Functions 3 January 5th 06 08:07 PM
Adding hrs demetri Excel Worksheet Functions 3 November 18th 05 11:25 PM


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