Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorksheetFunctions
I'm trying to use the WorksheetFunction.Mid to cut out a piece of text from a string and place it in an array. However, I can't get the Mid function to work. I keep getting a a 438 run time error message. Below is the code that I'm using. Sub MySub() Dim x As Variant Dim MyRange As Range Set MyRange = Worksheets("Sheet1").Range("A1") x = Application.WorksheetFunction.Mid(MyRange, 2, 5) MsgBox x End Sub Any help would be greatly appreciated. Thank, Peter -- PGalla06 ------------------------------------------------------------------------ PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260 View this thread: http://www.excelforum.com/showthread...hreadid=471936 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
WorksheetFunctions
Peter
just use: x = Mid(MyRange, 2, 5) Regards Trevor "PGalla06" wrote in message ... I'm trying to use the WorksheetFunction.Mid to cut out a piece of text from a string and place it in an array. However, I can't get the Mid function to work. I keep getting a a 438 run time error message. Below is the code that I'm using. Sub MySub() Dim x As Variant Dim MyRange As Range Set MyRange = Worksheets("Sheet1").Range("A1") x = Application.WorksheetFunction.Mid(MyRange, 2, 5) MsgBox x End Sub Any help would be greatly appreciated. Thank, Peter -- PGalla06 ------------------------------------------------------------------------ PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260 View this thread: http://www.excelforum.com/showthread...hreadid=471936 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel.worksheetfunctions | Excel Worksheet Functions | |||
can I use WorksheetFunctions ON arrays from VBA?? | Excel Programming | |||
No VBA help for Worksheetfunctions available | Excel Worksheet Functions | |||
Using WorksheetFunctions in Excel Macros | Excel Programming |