Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warn if no text in clipboard contents
I have the following sub (Excel 2007):
ActiveSheet.PasteSpecial Format:="Text" It fails if there is no text to paste. I'd like a MsgBox to prompt the user if there is no text. How do I do this? Also, is there some way I can warn if the text will paste to more than one cell? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warn if no text in clipboard contents
Function ValueOnly()
if Application.CutCopyMode = False then msgbox "Nothing to paste" else ActiveSheet.PasteSpecial Format:="Text" End if End Function -- Gary''s Student - gsnu2007L "John" wrote: I have the following sub (Excel 2007): ActiveSheet.PasteSpecial Format:="Text" It fails if there is no text to paste. I'd like a MsgBox to prompt the user if there is no text. How do I do this? Also, is there some way I can warn if the text will paste to more than one cell? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warn if no text in clipboard contents
I can help with your first question:-
If Application.ClipboardFormats(1) = -1 Then MsgBox "Clipboard Empty!" End If -- Alan Moseley IT Consultancy http://www.amitc.co.uk If I have solved your problem, please click Yes below. Thanks. "John" wrote: I have the following sub (Excel 2007): ActiveSheet.PasteSpecial Format:="Text" It fails if there is no text to paste. I'd like a MsgBox to prompt the user if there is no text. How do I do this? Also, is there some way I can warn if the text will paste to more than one cell? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The contents of the clipboard | Excel Programming | |||
Keep contents in clipboard | Excel Programming | |||
warn me when text appears | Excel Worksheet Functions | |||
can i get excel to warn me if text appears in 3 different cells | Excel Worksheet Functions | |||
Clipboard contents | Excel Programming |