Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default Macro using CLEAN & PROPER on a worksheet.

Good Morning,

I have a worksheet that has multiple columns of Cut & Paste
information...Some of the info is in All Caps and addtionally formated with
returns the make the text appear broken up...Can anyone help me with a macro
that runs whenever a button is clicked to run CLEAN & PROPER on columns "B,
G, L, M, N". The number rows in each column varies but always begins at row
3.

Thanks in adavance for your assistance,
Respectfully,
George
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Macro using CLEAN & PROPER on a worksheet.

Good Evening George,

Try this:

Sub CleanProper()
Dim cell As Range

Set RngA = Range("B3", Range("B" & Rows.Count).End(xlUp))
Set RngB = Range("G3", Range("G" & Rows.Count).End(xlUp))
Set RngC = Range("L3", Range("N" & Rows.Count).End(xlUp))

For Each cell In RngA
cell = WorksheetFunction.Proper(cell.Text)
cell = WorksheetFunction.Clean(cell.Text)
Next
For Each cell In RngB
cell = WorksheetFunction.Proper(cell.Text)
cell = WorksheetFunction.Clean(cell.Text)
Next
For Each cell In RngC
cell = WorksheetFunction.Proper(cell.Text)
cell = WorksheetFunction.Clean(cell.Text)
Next
End Sub

Regards,
Per

"George" skrev i meddelelsen
...
Good Morning,

I have a worksheet that has multiple columns of Cut & Paste
information...Some of the info is in All Caps and addtionally formated
with
returns the make the text appear broken up...Can anyone help me with a
macro
that runs whenever a button is clicked to run CLEAN & PROPER on columns
"B,
G, L, M, N". The number rows in each column varies but always begins at
row
3.

Thanks in adavance for your assistance,
Respectfully,
George


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get =Clean and =Proper Case to run on all cells in a col George Excel Worksheet Functions 0 February 3rd 10 07:41 PM
Clean Macro that WORKS... DR Excel Worksheet Functions 3 October 8th 09 09:52 PM
CLEAN function - macro?? George Applegate[_2_] Excel Worksheet Functions 2 September 15th 09 11:33 PM
CLEAN on whole Worksheet Gareth - Network analyst. Excel Discussion (Misc queries) 2 November 2nd 07 08:54 AM
Macro to clean up data diaare Excel Discussion (Misc queries) 8 October 25th 07 06:53 PM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"