• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Index/Match

Wid2001

New Member
I need to write a vba procedure for the following. I have two columns on a spreadsheet. The left column represents time and the right column represents the corresponding degrees above the horizon for the moon. The time starts with moonrise and continues for a 24 hour period using minutes (1400 total). The moon angle typical starts at about -1 at moonrise. What I need to do is write a procedure that will look through he moon angle column and when it gets to 30 degrees above the horizon return the associated time to a cell on another sheets then I need it to continue through the same column and return the time the moon falls back below 30 degrees. This will be run from a user form to populate cells on a card containing solar and lunar data for an aviation knee card/checklist. Any ideas?
 
Hi ,

Is VBA really required ? This can be done using formulae , and your userform code can retrieve the formulae results.

If you can upload your file , it will make things easier.

Narayan
 
The userform populates a card as I mentioned before. I am trying to keep as many formulas out of the card as possible but had not thought of doing the calculations on a hidden sheet and then have vba on the userform pull the results in. It is a fairly large project so I extracted what I think will work for helping me come up with the formulas for what I am trying to get done. The actual sheet is populated by formulas so I just pasted the values into this sheet. I think I understand the VBA to pull the result, I just can't figure out the formula for the values I need (the two times for above and below 30. Thanks for your response and time.
 

Attachments

  • Moon Angle Extract.xlsx
    50.2 KB · Views: 5
Yes. I think that will work perfectly. I have been experimenting with index/match and MIN but had not been able to come up with what you have here. Thanks very much for your time and effort.

Spence
 
Back
Top