Related:
- Excel spaces
- Excel marksheet - Guide
- Number to words in excel - Guide
- Excel apk for pc - Download - Spreadsheets
- Twitter spaces on desktop - Guide
- Kernel for excel - Download - Backup and recovery
6 responses
this macro is not working
it is removing one character when there is no alt+enter space
my file has alt+enter(char10) in some cells but not in all places
it is removing one character when there is no alt+enter space
my file has alt+enter(char10) in some cells but not in all places
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jul 30, 2009 at 08:42 PM
Jul 30, 2009 at 08:42 PM
does it work on cells where there is alt+enter. If so I do not know whether this will help.
Try this macro and see whether you succeed
Try this macro and see whether you succeed
Sub test() Dim c As Range For Each c In ActiveSheet.UsedRange if c.wraptext=true then c = Mid(c, 1, Len(c) - 1) end if Next End Sub
this code works fine first time and when cells are continuosly filled
exmaple
a1, a2 , a3, a4, a5 is filled fully
say a1,a2, a4,a5 is filled and a3 is blank
i get the following error runtime error 5
exmaple
a1, a2 , a3, a4, a5 is filled fully
say a1,a2, a4,a5 is filled and a3 is blank
i get the following error runtime error 5
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jul 31, 2009 at 05:58 AM
Jul 31, 2009 at 05:58 AM
your original idea using substitute function is generally correct. only this in macros you use
chr(10) and in spreadsheets you use char(10)
see this macro
the statment
c.wraptext=false is necessary.
chr(10) and in spreadsheets you use char(10)
see this macro
Sub test() Dim c As Range, x As String For Each c In ActiveSheet.UsedRange c.WrapText = False x = WorksheetFunction.Substitute(c, Chr(10), "") c = x Next c End Sub
the statment
c.wraptext=false is necessary.
Didn't find the answer you are looking for?
Ask a question
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jul 29, 2009 at 09:08 PM
Jul 29, 2009 at 09:08 PM
try this macro and tell whether you succeed
Sub test() Dim c As Range For Each c In ActiveSheet.UsedRange c = Mid(c, 1, Len(c) - 1) Next End Sub