Referencing a Cell in VBA

A

Aaron1978

Hi All,

Below is a few lines of VBA from my spread sheet:

Function fnSMYS(strSteelGrade)
If Cells(4, 3).Value = "A25" Then
fnSMYS = 172.4
ElseIf (Cells(4, 3).Value = "A") Then
fnSMYS = 206.9
.....etc

As you can see it is a function and it is checking the value of cel
4,3 (or 4C) and then it assigns fnSMYS a value depending on what is i
4,3. In my spread sheet I have called cell 4,3 "Grade". How can
replace the line Cells "(4,3).Value" in VBA with a reference to th
name "Grade"?

Best Regards,

Aaro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top