Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default transforming excel cell contents in word document, with coma separated.


transforming excel cell contents in word docum ent, with coma
separated.

Hi members,
It will be nice if anybody could tell me how to copy cell
contents..(eg: From A1,A2,A3,A4,A5 etc..downwards )to word document in
the format contents of A1,A2,A3,A4,a5.

I know how to transform a certain range of cells from excel to word in
the same(ie.as tables itself) form, but how to change the format with
coma separation.

TIA

Roshin


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default transforming excel cell contents in word document, with coma separated.

Show me your code that copies the range and I will show how to copy the
values.

RBS

"roshinpp_77"
wrote in message
...

transforming excel cell contents in word docum ent, with coma
separated.

Hi members,
It will be nice if anybody could tell me how to copy cell
contents..(eg: From A1,A2,A3,A4,A5 etc..downwards )to word document in
the format contents of A1,A2,A3,A4,a5.

I know how to transform a certain range of cells from excel to word in
the same(ie.as tables itself) form, but how to change the format with
coma separation.

TIA

Roshin


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile:
http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default transforming excel cell contents in word document, with coma separated.


Hi friend,
This is my macro for copying a range named "rpp" to a new word doc
generated in c:\autogenr.doc.



My input is:
COL: C
1001
1002
1003
1004
1005
1006
1007

`my output in word has to be:
1001,1002,1003,1004,1005,1006,1007 etc..till the end
Below macro will copy the entire range as it is (as table) from excel
to doc.

Sub cmdcopytoword_Click()
'copy sheet to clipboard
Range("rpp").Select
Selection.Copy
Range("B3").Select

' open Word
Dim appWD As Object
Set appWD = CreateObject("Word.Application")
appWD.Visible = True

'open a new document in Word
appWD.Documents.Add DocumentType:=wdNewBlankDocument

' paste from clipboard
appWD.Selection.Paste
With appWD.ActiveDocument
..SaveAs "C:\autogenr.doc"
..Close
End With


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default transforming excel cell contents in word document, with coma separated.

Sub cmdcopytoword_Click()

Dim i As Long
Dim arr
Dim strRange As String

strRange = Range("rpp").Cells(1)

If Range("rpp").Cells.Count 1 Then
arr = Range("rpp")
For i = 2 To UBound(arr)
strRange = strRange & "," & arr(i, 1)
Next
End If

Cells(1) = strRange
Cells(1).Copy

' open Word
Dim appWD As Object
Set appWD = CreateObject("Word.Application")
appWD.Visible = True

'open a new document in Word
appWD.Documents.Add DocumentType:=wdNewBlankDocument

' paste from clipboard
appWD.Selection.Paste
With appWD.ActiveDocument
SaveAs "C:\autogenr.doc"
Close
End With

End Sub


RBS


"roshinpp_77"
wrote in message
...

Hi friend,
This is my macro for copying a range named "rpp" to a new word doc
generated in c:\autogenr.doc.



My input is:
COL: C
1001
1002
1003
1004
1005
1006
1007

`my output in word has to be:
1001,1002,1003,1004,1005,1006,1007 etc..till the end
Below macro will copy the entire range as it is (as table) from excel
to doc.

Sub cmdcopytoword_Click()
'copy sheet to clipboard
Range("rpp").Select
Selection.Copy
Range("B3").Select

' open Word
Dim appWD As Object
Set appWD = CreateObject("Word.Application")
appWD.Visible = True

'open a new document in Word
appWD.Documents.Add DocumentType:=wdNewBlankDocument

' paste from clipboard
appWD.Selection.Paste
With appWD.ActiveDocument
SaveAs "C:\autogenr.doc"
Close
End With


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile:
http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default transforming excel cell contents in word document, with coma separated.


Thanks RB Smissaert ,
but still another problem arised in between.
Your modification is working perfectly for small numbers.But for me
each cell is a 6 digit number and it is going for 50 to 60 cells.ie.

100001
122200
233333
133444
345566
......
...
upto 50 lines
So when i open the word file i am getting the output as
"#############".
Even in the cell(1) of excel sheet i am not able to set a correct
format that shows me 100001,122200,......

Your suggestion is awaited,

TIA
Roshin


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default transforming excel cell contents in word document, with coma separated.


Thanks friend..i got it.
Instead of Cells(1), i gave Cells(1,1) and now its working perfectly.

Once again
Thanks a lot.

regards
Roshi

--
roshinpp_7
-----------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...fo&userid=3492
View this thread: http://www.excelforum.com/showthread.php?threadid=56202

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default transforming excel cell contents in word document, with coma separated.

If it works then fine, but there is absolutely no difference (that I know
of) between Cells(1) and Cells(1, 1)

RBS

"roshinpp_77"
wrote in message
...

Thanks friend..i got it.
Instead of Cells(1), i gave Cells(1,1) and now its working perfectly.

Once again
Thanks a lot.

regards
Roshin


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile:
http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=562026


Reply
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
Show contents of Word document in cell wal Excel Discussion (Misc queries) 0 November 7th 08 02:48 AM
Exporting excel cell contents to word document kaiser Excel Programming 2 September 12th 05 11:24 AM
Exporting multiple cell contents into word document Davy L Excel Worksheet Functions 1 September 6th 05 04:06 AM
How do I imbed a Word document into an Excel cell? Baxter Excel Discussion (Misc queries) 2 March 12th 05 01:55 PM
Help, insert a word document contents into excel tab? Dan Ward Excel Discussion (Misc queries) 2 December 15th 04 12:01 AM


All times are GMT +1. The time now is 04:44 PM.

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"