Macro not starting

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I've got a strange one here. On some of my macines this
macro works while others don't. I've checked to be sure
everyone's on the same rev....still no luck.

Any ideas? Here's the macro that is being used:

Public Function GetValueFromSheet(C As String, L As
Integer) As String
FName = ActiveSheet.Range("D1:E1").Cells(1, 1).Value
SName = ActiveSheet.Range("D1:E1").Cells(1, 2).Value
GetValueFromSheet = Workbooks(FName).Worksheets
(SName).Range(C & L).Value
End Function

And the cell formula looks like this:
 
Try this and let me know if it makes a difference:

Public Function GetValueFromSheet(C As String, L As
Integer) As String
FName = ActiveSheet.Cells(1, 4).Value
SName = ActiveSheet.Cells(1, 5).Value
GetValueFromSheet = Workbooks(FName).Worksheets.(SName).Range(C
L).Value
End Function

- Piku
 

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

Back
Top