none
How to copy User Selected Cells - VBA RRS feed

  • Question

  • I need one macro Button to copy only selected \Highlighted cells.

    I could use COPY option, but it has many spaces in it.

    I could use TRIM\Clean but the cells which i intent to copy are in random places.

    So i need a vba to copy the highlighted cells which excludes the extra spaces within the cell.

    I can highlight any cell randomly and use the Macro button to copy the contents only with no spaces in it.

    Monday, October 19, 2015 10:00 AM

Answers

  • To any other random sheet or diff file.
    All i want the macro is to copy on the cell content with no extra spaces.
    I shall use a manual paste on wherever the user want to

    That is not possible.

    You can only remove the spaces after you've pasted the cells/contents:

    Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart

    resp.

    Selection.Replace What:="  ", Replacement:=" ", LookAt:=xlPart

    to replace double blanks with single blanks.

    Andreas.


    Tuesday, October 20, 2015 7:04 AM

All replies