ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check if empty (https://www.excelbanter.com/excel-programming/305696-check-if-empty.html)

stevenmckeon[_4_]

Check if empty
 
Hi All,

I have a sheet that copies cells from excel to word. I need to be abl
to determine if the clipboard copy is empty - if its empty it fails.

Sheets("Page1").Select
Range("C305:E318").Copy

Basically I need to be able to say if the range to be copied is in fac
empty - ignore. If range to be copied has value then paste it.

I have code to copy and paste but I need to run an IF that determine
whether the copy and paste is run or not.

Any assistance appreciated.

Thnaks

Stev

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Check if empty
 
Hi
try
with worksheets("page1")
if application.counta(.range("C305:E318"))0 then
.range("C305:E318").copy
'....
end if
end with

--
Regards
Frank Kabel
Frankfurt, Germany


Hi All,

I have a sheet that copies cells from excel to word. I need to be

able
to determine if the clipboard copy is empty - if its empty it fails.

Sheets("Page1").Select
Range("C305:E318").Copy

Basically I need to be able to say if the range to be copied is in
fact empty - ignore. If range to be copied has value then paste it.

I have code to copy and paste but I need to run an IF that determines
whether the copy and paste is run or not.

Any assistance appreciated.

Thnaks

Steve


---
Message posted from http://www.ExcelForum.com/



stevenmckeon[_5_]

Check if empty
 
For more clarification here is more of my code. How would I incorporat
the changes correctly?


+++++++++++
' Copy the data for the new document to the clipboard
Sheets("Page1").Select
'Range("C305:E318").Copy

' Tell Word to paste the contents of the clipboard into th
word doc

If wrdDoc.Bookmarks.Exists("three") = True Then

'Paste it
wrdDoc.Bookmarks("three").Select
appWD.Selection.Paste
End If
+++++++++++

The selected range contain text and numbers they are general fields.

Thnak

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com