LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Searching and Then Copy Cell to word


Please Help!! I am Trying to search this sheet for TxtCaseName, Then
Copy Cell 42 this is what it should say i think...
am i doing something wrong?it gives me the error Object Variable not
set :(


Private Sub CmdPrint_Click()
Dim sh As Worksheet
Dim WrdApp As New Word.Application
Dim wrdDoc As New Word.Document

sh.Columns(1).Range("A5").Find(What:=TxtCaseName,
LookIn:=xlFormulas).Offset(0, 42).Copy

' Create a new Word Document
Set wrdDoc = WrdApp.Documents.Add(DocumentType:=wdNewBlankDocum ent)
WrdApp.Visible = True

WrdApp.Selection.Paste

Set wrdDoc = Nothing
Set WrdApp = Nothing

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to copy the first word or two words from a cell containing a complete sentence to another cell jonny Excel Discussion (Misc queries) 7 May 19th 23 03:43 AM
Copy Word cell containing Shift/Enter to Excel.Keep it as 1 cell Nancy Vazquez Excel Discussion (Misc queries) 0 April 1st 09 07:05 PM
searching a cell for a contained text word Doug K Charts and Charting in Excel 0 June 20th 05 09:10 PM
Searching using part of a word rather than whole word in vba Devitt[_3_] Excel Programming 1 October 12th 04 10:33 AM
Searching using part of a word rather than whole word in vba Devitt[_4_] Excel Programming 0 October 12th 04 10:32 AM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"