Advertisement

07.02.2008 at 11:32AM PDT, ID: 23534590
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

How do I pass a cell reference through to my function code instead of the cell contents

Asked by David1gb in Microsoft Excel Spreadsheet Software, VB Objects, VB Script

Tags:

I can usually figure out ways to do most things in excel and while the solutions may not be elegant they work.

This has me stumped

I am tring to program a function for using within the excel sheet. The function I have called latest  will in theory for the start cell chosen check to see if the cell in in the column with the right title (in my spread sheet ASP ) then check to see if the cell has a value or not. If it finds a value it returns it to the function and stops else moves progresivley to the right.

The Problem

I can't figur out how to carry the cell refrence though to the function whatever I try the starting cell shoesn when the user  inputs the arguments always returns the value of the start cell ans not it's Address I I want AN4 to come though ans I get the value in AN4 instead .

I appologize if this is very trivial but 4 hour later of internet searches and plying in the vb help and I am no further.

Also the soloution must allow the fomula to be copied down in the spread sheet and still return the correct numbers

Thanks in advance for suggestions

Regards to all

from

David

( an excel hack and amateur)Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
Function Latest(Columnheading As String, headingrow As Integer, startcell As Range)
 
Dim CH As String
Dim CHR As Integer
Dim DIR As Integer
Dim N As Integer
Dim X As Variant
 
CH = Columnheading
 
X = Range(startcell)
Range(X).Select
Range(X).Activate
N = Range(X).Row - headingrow
I = Range(X).Column
c = 0
Do Until c = I
 
If ActiveCell.Offset(-N, -c).Value = CH Then
If ActiveCell.Offset(N, -c).Value <> 0 Then
Latest = ActiveCell.Offset(N, -c).Value
End
Else
End If
Else
c = c + 1
End If
Loop
 
End Function
[+][-]07.02.2008 at 11:40AM PDT, ID: 21919335

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, VB Objects, VB Script
Tags: Excel vb user defined functions
Sign Up Now!
Solution Provided By: rettiseert
Participating Experts: 3
Solution Grade: B
 
 
[+][-]07.02.2008 at 11:44AM PDT, ID: 21919364

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 12:02PM PDT, ID: 21919526

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 12:17PM PDT, ID: 21919678

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 12:27PM PDT, ID: 21919763

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 04:09PM PDT, ID: 21921619

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628