View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norbert[_4_] Norbert[_4_] is offline
external usenet poster
 
Posts: 52
Default How to suppress a message box from popping up during a macro


for me following code works even if there are values in I13:K13:

With ActiveSheet
.Unprotect
.Range("I13:K13").Clear
.Range("F13").TextToColumns Destination:=.Range("I13"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, Other:=True, OtherChar:="+", _
FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _
TrailingMinusNumbers:=True
End With
Regards
Claus B.
--
Windows10
Microsoft 365 for business



Hi Claus,
now it works, the only thing I realised is that it clears also the formats of range I13:K13 and when I changed your
code to:
..Range("I13:K13").ClearContents (instead of: .Range("I13:K13").Clear)

it comes up with the same message box as before. It would be nice if I could keep my formatting but if it is not
possible, I can also live with what it looks now.

Regards,
Norbert