View Single Post
  #6   Report Post  
Colin Hayes
 
Posts: n/a
Default

In article , Frank Kabel
writes
Hi
you may then post (the relevant part) of your existing event macro


Hi all

OK I managed to get this working , using LEFT(cell,45) as suggested.

It was rather more straightforward than I thought.

This is the final code :


Dim lrow As Long
With ActiveSheet
lrow = Range("A" & Rows.Count).End(xlUp).Row
'Range("A1:A" & lrow).FillDown
End With

'Limit Column A to a Maximum of 45 characters

Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Range("B2").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],45)"
Selection.AutoFill Destination:=Range("B2:B" & lrow),
Type:=xlFillDefault
Range("B2:B" & lrow).Select
Columns("B:B").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("B:B").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft


Thanks for your help.


Best Wishes

Drno