josephll
Board Regular
- Joined
- Nov 8, 2008
- Messages
- 51
I have built, used others mostly, code that copies a spreadsheet range into lotus notes through MS word. Everything works well, I am just trying to fine tune the formating to make it look better in the email. (Everyone from the CEO down to my immediate boss sees this email.) The range has 67 rows in it some have a value some are blank. The problem lies in copying the blank rows, there are formulas in some of these rows but no values, creating a a lot of space between lines once it is pasted into word.
Here is the copy and paste I am using:
Is there a change I can make to the code that will help?
Thank you for all your help so far with this project. I am sure someone on here can fix me.
Here is the copy and paste I am using:
HTML:
Sheets("Summary").Range("b2:t67").Copy.SpecialCells (xlCellTypeVisible)
'Create a temporary Word Document
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True 'True to aid debugging
WordApp.Documents.Add
'Paste into Word document and copy to clipboard
With WordApp.Selection
.PasteSpecial DataType:=2 'Enum WdPasteDataType: 10 = HTML; 2 = Text; 1 = RTF this was a big help
.WholeStory
.Copy
End With
'Paste from clipboard (Word) to Lotus Notes document
.Paste
Application.CutCopyMode = False
Thank you for all your help so far with this project. I am sure someone on here can fix me.