LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a loop VBA with an if statement


I need help with a satement that will verify the date in one
row(sheet1.A3) and a second value(sheet1.c3) are equal to set values.
If they are both equal i need to start a running total. then display
that total on a diffrent sheet.

I understand the basics of programing, just not the language that excel
uses. I was going to have the user enter the total number of
itterations.

I need to know how to increase the row using the loop variable. and I
need to know how to pass data from workbook, to VBA, and back.

So in excel say sheet1.A1 is the total number of times to do the loop.
stuff in { } is what i need help with.
the IF is writen in what Excel uses for an if statement which i believe
is not what the VBA will use.

num = 0
For loopx = 3 to Sheet1.A1
If((AND(Sheet1!A3{this needs to increase with the count of loopx} =
dateiamlookingfor, Sheet1!C3{this needs to increase with the count of
loopx} = valueiamlookingfor)),num = num + E3{this needs to increase
with the count of loopx}
next loopx
{Print num to a cell on sheet2}

I know its alot to ask, my brain is just dead, and i do not know much
about excel...yet

Thanks


--
kixelsid
------------------------------------------------------------------------
kixelsid's Profile: http://www.excelforum.com/member.php...o&userid=31901
View this thread: http://www.excelforum.com/showthread...hreadid=516301

 
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
for loop with if statement Steve Excel Worksheet Functions 1 February 17th 10 07:56 PM
If statement - Loop? George Excel Discussion (Misc queries) 1 March 14th 06 07:06 AM
continue statement in a loop rozner Excel Programming 4 August 2nd 05 03:30 PM
Loop including IF statement yalex[_7_] Excel Programming 1 July 8th 04 03:07 PM
Do Until loop with if statement Sandy[_3_] Excel Programming 4 July 17th 03 11:06 AM


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