VBA Excel Does a Function Like this exist?

In summary, The conversation starts with someone asking for help finding a function that returns a specific character from a string. They then realize that they have been using the function all day and feel foolish. The conversation then shifts to a question about what the object is called when using markup languages, specifically in this case the "<ABC>" object. The conversation ends with someone suggesting that the Mid() function should work for the initial question.
  • #1
Saladsamurai
3,020
7
GO TO POST #2 for new question please


I hate to start a thread just for this, but my Googling skills SUCK today!

Is there a function that returns what character is in a given position within a string?

For example,

Dim MyName As String
MyName = "SaladSamurai"

FunctionINeed(2)


Then it would return "a"

I could write something...but I hate to reinvent the wheel on this one.

Thanks!
 
Last edited:
Technology news on Phys.org
  • #2
Nevermind, I am a moron. I have been using it all day! Mid ... idiot...

BUT, while you are reading this, unrelated question:

You know in XML or other mark up languages how they wrap some thing with those command things (yes, I realize that I am butchering the language here)? For example

<ABC>X</ABC> What is the name of the entire "<ABC>" object? Is it a 'command' or a what?

I just want to name my function appropriately. It grabs the '<'and '>' and whatever is in between.
 
Last edited:
  • #3
yeah, Mid() should do the trick.
 

1. What is VBA Excel?

VBA (Visual Basic for Applications) Excel is a programming language used for creating macros and automating tasks in Microsoft Excel. It allows users to write custom code to perform specific actions in Excel, such as calculations, data manipulation, and formatting.

2. What is a function in VBA Excel?

A function in VBA Excel is a block of code that performs a specific task and returns a result. It can be used to simplify complex tasks and make them more efficient. Functions can be built-in or custom-made by the user.

3. How do I know if a specific function exists in VBA Excel?

You can search for a function in the VBA Excel documentation or online resources. You can also use the built-in Object Browser in the VBA editor to browse through the available functions in Excel.

4. Can I create my own custom function in VBA Excel?

Yes, you can create your own custom functions in VBA Excel. This allows you to extend the capabilities of Excel and automate tasks according to your specific needs.

5. Are there any limitations to using functions in VBA Excel?

Like any programming language, there may be limitations to using functions in VBA Excel. These limitations may include compatibility issues with different versions of Excel and the complexity of writing and debugging code. It is important to thoroughly test and troubleshoot your functions before using them in a production environment.

Similar threads

  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
17
Views
2K
  • Programming and Computer Science
Replies
18
Views
5K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
2
Views
907
  • Feedback and Announcements
Replies
19
Views
2K
  • Programming and Computer Science
Replies
9
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
Replies
3
Views
2K
Back
Top