View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Gerstman David Gerstman is offline
external usenet poster
 
Posts: 57
Default Beginner to VBA

I hope the articles help. I found it a good way to learn myself. (It also
solves the problem of coming up with an example that could be wrong.)

David

"guppster01" wrote:

Thank you

"David Gerstman" wrote:

These look like good starting points
http://msdn.microsoft.com/library/de...fice03_vba.asp

and
.
http://msdn2.microsoft.com/en-us/lib...s thatcontain



"guppster01" wrote:

Here is the beginner in me: How do I do that? Can you give me an example?

"David Gerstman" wrote:

Set up a range of columns and loop through the columns using a for ... loop.
Check the corresponding columns using the offset property.

"guppster01" wrote:

This is what I need to do:
I have 3 columns of information on sheet 1 that look like this:

Dept. Regular Other
1 5 0
2 0 5
3 0 0
4 5 0

I need to create a program that searches column 2 and 3 for numbers 0, then
when it finds one, it will take that number and the respective department
number, and place them in specific cells on sheet2. Then it keeps searching
for numbers that are 0 and when it finds another, it does the same thing to
the next available cells under the cells I put the first find into.

The output I want is something like this

Regular Other
Amt. Dept. Amt. Dept.
5 1 5 2
5 4


I was thinking there was going to be a For Next loop with if then statements
searching respective columns, but I just don't know the code for searching
the columns, then copying the appropriate data to the cells I need them to go
into.

Any help would be appreciated.

Thanks