ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to record macro to work on selected column/row? (https://www.excelbanter.com/excel-programming/293599-how-record-macro-work-selected-column-row.html)

Olezhka

How to record macro to work on selected column/row?
 
I want to be able to use a TRIM function, to trim the values in
particular column, then copy/paste values to the same column. How woul
I record macro to work on the particular column that I have selected
as every time, it is a different column that I work on

--
Message posted from http://www.ExcelForum.com


Frank Kabel

How to record macro to work on selected column/row?
 
Hi
you have to change the macro manually. Something like
sub foo()
dim rng as range
dim cell as range
set rng = selection
for each cell in rng
cell.value = Trim(cell.value)
next
end sub


--
Regards
Frank Kabel
Frankfurt, Germany

I want to be able to use a TRIM function, to trim the values in a
particular column, then copy/paste values to the same column. How
would I record macro to work on the particular column that I have
selected - as every time, it is a different column that I work on?


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com