Hello,
What AHK commands mimic the following two Excel functions?
=MID()
Syntax: MID(text, start_num, num_chars)
=VALUE()
Syntax: VALUE(text)
For example, the following formula extracts a string of 3 characters beginning with character #2:
=MID("W369A4KM",2,3) = "369"
And this formula converts a text string (of numbers) to a numeric value:
=VALUE("369") = 369
So combined,
=VALUE(MID("W369A4KM",2,3)) = 369
Can someone post the equivalent AHK formulas, both individually and combined?
Thanks
AHK commands for Excel =MID() & =VALUE() Topic is solved
-
- Posts: 312
- Joined: 19 Nov 2013, 08:44
AHK commands for Excel =MID() & =VALUE()
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
- FanaticGuru
- Posts: 1905
- Joined: 30 Sep 2013, 22:25
Re: AHK commands for Excel =MID() & =VALUE() Topic is solved
Code: Select all
X := SubStr("W369A4KM", 2, 3)
MsgBox % X
X := X / 3 + 5
MsgBox % X
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
-
- Posts: 312
- Joined: 19 Nov 2013, 08:44
Re: AHK commands for Excel =MID() & =VALUE()
Thanks FG. That's really helpful (including the comment re variables). I need to find/create a chart showing equivalent functions because I am far more comfortable with Excel formulas than with AHK.FanaticGuru wrote:There is not really much use for a command like "Value" in AHK. AHK does not have variable types and pretty much treats a variable like a string or a number as needed.
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
- FanaticGuru
- Posts: 1905
- Joined: 30 Sep 2013, 22:25
Re: AHK commands for Excel =MID() & =VALUE()
It is best to use AHK functions when possible but if you really need to use an Excel function in AHK you can, assuming Excel is installed on the computer.WeThotUWasAToad wrote:Thanks FG. That's really helpful (including the comment re variables). I need to find/create a chart showing equivalent functions because I am far more comfortable with Excel formulas than with AHK.
https://autohotkey.com/boards/viewtopic ... 83#p133783
It allows stuff like this.
Code: Select all
Xl := ComObjCreate("Excel.Application") ; This only needs to be done once in the script (basically starts a hidden Excel running)
Payment := Xl.WorksheetFunction.Pmt(5 / 1200, 6 * 12, -10000) ; Monthly Payment for $10,000 loan at 5% for 6 years.
MsgBox % Payment
Xl.Quit() ; Close your hidden Excel before ending your script, could make this an OnExit routine
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Who is online
Users browsing this forum: Google [Bot], jaquesy, Mannaia666, Pareidol, RussF and 137 guests