Forum Discussion

NRASA0743's avatar
NRASA0743
Copper Contributor
Jul 20, 2022
Solved

Inserting formula in a cell

Hello, I'm trying to insert a RIGHT formula in one column but my macros goes into break mode. Wanted the variable cell to be whatever cell I selected with the mouse before running the macro. Any Adv...
  • Martin_Weiss's avatar
    Martin_Weiss
    Jul 21, 2022

    Hi NRASA0743 

     

    yes, that's because this was the formula that you wanted to put in the cell based on your original question. 

     

    Sorry, now I think I understand: You want only the last 4 characters of whatever is currently in the cell? This should do it:

     

    Selection.Value = Right(Selection.Value, 4)

     

    Please note that this works only for single cells, not for a selection of multiple cells.

Resources