Using VBA to move letter/symbol to cell to the right

Copper Contributor

I am trying to write code to move the symbol or letter in a range to cell to the right, so the next column over. My data is in E19:E54 and if there is < or F in with the numbers I want that moved to F19:F54. Example 1: E19 is "<0.825" I want E19 to be "0.825" and column F19 to be "<"

Example 2: E20 is "0.0211F" I want E19 to be "0.0211" and F20 to be "F"

3 Replies

@JennaSmith495 

 

If we were sitting down face-to-face, I'd want to ask a few questions before resolving this. Why? Because there's a fair amount of ambiguity in your request, despite the specificity of the two examples you give.

 

  1. Your opening sentence refers to "the symbol or letter" so a reasonable inference is that there could be a variety of symbols and letters, >,<,!,#,+.... and F,G,H,...    Is that not only an inference but an accurate statement of the reality? It would make a big difference on how to resolve.
  2. Are there times when BOTH a symbol AND a letter are present? What then?
  3. Presumably the data in column E is text. But what you want after trimming symbols and letters is numeric in form; do you want it preserved as numbers but in text form, or do you want it to be values?

 

Would it be acceptable to create THREE new columns from whatever formulae end up being used, so that

  • in column X you have whatever symbol preceded the number, 
  • in column Y you have the number
  • in column Z you have the text that followed the number

I'm hinting that such an approach would be clearer

It didn't save the last edits I made before posting, my apologies for the confusion. I want to take only the cells with F or < in them and move that to the next cell. I already have code written to create this spreadsheet and am trying to add this in. I cannot simply do a formula and I cannot change the integrity of the spreadsheet by adding additional columns. Do you know how to write code for this?
OK. Thanks for clarifying. I'm NOT a VBA person, generally preferring to do formulas, finding them more reliable. So I'll defer to others who are gifted in VBA.