Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() try this 'These instructions pre typed & are worded to cater for the novice programmer 'To install macro to correct location 'Copy this macro 'GoTo Excel 'Open VB Editor by pressing Alt + F11 'Just below the menus & toolbars on the left you should see Project - VbaProject window 'In this window you will see ThisWorkbook 'double click on ThisWorkbook - opens ThisWorkbook module sheet 'Paste macro code into big window on right Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim wS As Worksheet Dim c As Range For Each wS In Worksheets For Each c In wS.UsedRange If Not c.HasFormula Then c.Value = Trim(c.Value) End If Next c Next wS ThisWorkbook.Save End Sub -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.thecodecage.com/forumz/member.php?userid=18 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=23224 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trim | Excel Discussion (Misc queries) | |||
Trim | Excel Worksheet Functions | |||
VLOOKUP Trim vs. No Trim | Excel Programming | |||
VBA Trim and Application.worksheetfunction.Trim | Excel Programming | |||
Trim like worksheet Trim | Excel Programming |