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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

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,181,439
Messages
5,929,918
Members
436,705
Latest member
Priti19

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