Milton Clark
asked on
Copying selected text (substring) from the ActiveCell
I want to write a VBA macro that can be invoked via hot-key combination which takes whatever portion of the text selected within the ActiveCell and copies it. The macro will then take the copied text and paste it into another cell.
There appear to be two separate challenges:
1. I can't find code that will select and copy just the highlighted text from a cell.
2. If I go into a cell and select some text, it appears that hot-keys are not active, so I have no way to invoke the macro.
Any assistance is greatly appreciated.
There appear to be two separate challenges:
1. I can't find code that will select and copy just the highlighted text from a cell.
2. If I go into a cell and select some text, it appears that hot-keys are not active, so I have no way to invoke the macro.
Any assistance is greatly appreciated.
I don't think you can run macros whilst you are editing cells, so perhaps a different approach is needed. What are you trying to achieve?
ASKER
The group of users I'm working with spend hours of intensive data review and extraction. From a single Description column, they typically have to grab 6-8 pieces of data out of one cell. So they highlight portions of the text, copy it and paste it into another column.
I want to simplify this process by highlighting the needed text, then using the appropriate macro to place it in the appropriate column, thereby eliminating the need to do: ... copy, navigate to target cell, paste, navigate back.
There are no usable markers or delimiters in the text ... it's all done by eyes-on-data and extracting it into the appropriate columns.
Does that help?
I want to simplify this process by highlighting the needed text, then using the appropriate macro to place it in the appropriate column, thereby eliminating the need to do: ... copy, navigate to target cell, paste, navigate back.
There are no usable markers or delimiters in the text ... it's all done by eyes-on-data and extracting it into the appropriate columns.
Does that help?
ASKER
Just to clarify ... they highlight 6-8 pieces of data and paste each into the appropriate one of 8 columns.
"it's all done by eyes-on-data" - what are they looking for? Presumably there is some sort of pattern.
I don't think you can directly do what you want. However if you are interested in a workaround then you can find at least two here
https://www.experts-exchange.com/questions/27044799/How-to-manipulate-text-within-an-excel-user-form.html
https://www.experts-exchange.com/questions/27044799/How-to-manipulate-text-within-an-excel-user-form.html
ASKER
I know .. that's what I would hope for, too, but it's not the case.
So they have to eyeball it, highlight the piece of data they want copied, then move it to the proper target.
If I can't do this in native Excel because I can't run macros while in edit mode, could I do the equivalent in a userform? Can I select and copy a portion of the text sitting in a text field, then use hot-key combos associated with a button (and associated macro) to move it to the target cell?
Thanks for your suggestions.
So they have to eyeball it, highlight the piece of data they want copied, then move it to the proper target.
If I can't do this in native Excel because I can't run macros while in edit mode, could I do the equivalent in a userform? Can I select and copy a portion of the text sitting in a text field, then use hot-key combos associated with a button (and associated macro) to move it to the target cell?
Thanks for your suggestions.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.