Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Copy cell value and delete white spaces at the end?
Hi experts!
I made a little excel worksheet to make my daily work a little easier. (Excel 97) Now I have a simple problem! I have a macro applied to a button and when I click on it a cell is copied in the clipboard because I need the data in a different application. The date in the cell is variable and changes depending what I did before I hit the copy button. The cell is filled like that: Range("K35").Select ActiveCell.FormulaR1C1 = ActiveCell.Value & Cells(1, 1) That works great but when I paste the content from the clipboard in another application (ex. notepad) there are a lot of white spaces after the cell content. I need to delete this white spaces before I paste the value in the other application. I tried a few times with "Trim" but with no success. I don't know much about macro programming. To copy the cell with the macro, I select the cell and then I use the copy funtion. How can I delete this white spaces? Range("F5").Select Selection.Copy Thank you so much! Regards, Michael |
#2
|
|||
|
|||
Quote:
dim a as variant a=activeworkbook.sheets("sheet1").range("F5") Application.WorksheetFunction.Clean(Trim(a)) a.copy or directly the trim the data in the excel spreadsheet and use vba code to copy and paste it. all the best
__________________
Thanks Bala |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete spaces | Excel Discussion (Misc queries) | |||
An easy way to delete spaces in a cell... | New Users to Excel | |||
how do I delete the last two spaces in a cell | Excel Discussion (Misc queries) | |||
Remove white spaces in Back | Excel Discussion (Misc queries) | |||
Delete Spaces and Join Text in Cell | Excel Worksheet Functions |