Look up a number in an Excel page

WHYME

New Member
Joined
Jan 12, 2005
Messages
10
I need the code to look up a number set in an excel worksheet page.

PRINTERGROUP PRINT Max No. of Files 10

This is on a page called Report Option. I want it to look at the Max number of files number.

This is the code I have now. Can anyone see a problem?

Public Function GetMaxNumberOfFiles() As Integer

On Error GoTo erh

'Assign the value of the cell.
GetMaxNumberOfFiles = sheetReportOptions.Cells(sheetQueries.GetDestinationRow(maxNoFilesQuery), sheetQueries.GetDestinationCol(maxNoFilesQuery))
Exit Function
'Standard error handling.
erh:
AppShowError "GetMaxNumberOfFiles", strReportOptionsErrorName
End Function
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

RalphA

Well-known Member
Joined
May 14, 2003
Messages
3,829
Assuming that you have the string, "PRINTERGROUP PRINT Max No. of Files 10" in one cell, cay cell C3, you could put this formula in another cell, say cell D3:
=RIGHT(C3,LEN(C3)-LEN("PRINTERGROUP PRINT Max No. of Files "))
This would show the number 10, in this case, in D3. Then, in your VBA code, you could simple refer to cell D3.
 

Forum statistics

Threads
1,148,393
Messages
5,746,437
Members
424,018
Latest member
dionlkk6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top