Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
LDBlanes
 
Posts: n/a
Default Saving a cell name as a word doc

I have a list of cells in an excel spreadsheet that I want to use to create
separate word documents from a generic word document.

right now I'm copying the cell name switching to Word opening file Save as
and pasting the name.

It doesn't take long but I've got over a thousand names to save as. Is
there any way in Excel or Word that I can automate this process?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Saving a cell name as a word doc

Say we have three names in A1 thru C1:

Firstfl
Secondfl
Thirdfl

First put a dummy name in D1. The enter and run this macro:


Sub Macro1()
Dim s As String
Dim i As Integer
For i = 1 To 4
s = Cells(i, 1).Value
fname = "C:\" & s & ".txt"
ActiveWorkbook.SaveAs Filename:= _
fname, FileFormat:= _
xlText, CreateBackup:=False
Next
x = Shell("cmd.exe /c rename C:\*.txt *.doc", 1)
End Sub

The For loop creates a set of .txt files and the Shell command renames them
as .doc. You will have three .doc files as a result.


You can increase from three to any number. The extra dummy entry in needed
to insure the last real entry gets renamed.
--
Gary''s Student....gsnu02012006


"LDBlanes" wrote:

I have a list of cells in an excel spreadsheet that I want to use to create
separate word documents from a generic word document.

right now I'm copying the cell name switching to Word opening file Save as
and pasting the name.

It doesn't take long but I've got over a thousand names to save as. Is
there any way in Excel or Word that I can automate this process?

  #3   Report Post  
Posted to microsoft.public.excel.misc
LDBlanes
 
Posts: n/a
Default Saving a cell name as a word doc

Thanks it works like a charm.

"Gary''s Student" wrote:

Say we have three names in A1 thru C1:

Firstfl
Secondfl
Thirdfl

First put a dummy name in D1. The enter and run this macro:


Sub Macro1()
Dim s As String
Dim i As Integer
For i = 1 To 4
s = Cells(i, 1).Value
fname = "C:\" & s & ".txt"
ActiveWorkbook.SaveAs Filename:= _
fname, FileFormat:= _
xlText, CreateBackup:=False
Next
x = Shell("cmd.exe /c rename C:\*.txt *.doc", 1)
End Sub

The For loop creates a set of .txt files and the Shell command renames them
as .doc. You will have three .doc files as a result.


You can increase from three to any number. The extra dummy entry in needed
to insure the last real entry gets renamed.
--
Gary''s Student....gsnu02012006


"LDBlanes" wrote:

I have a list of cells in an excel spreadsheet that I want to use to create
separate word documents from a generic word document.

right now I'm copying the cell name switching to Word opening file Save as
and pasting the name.

It doesn't take long but I've got over a thousand names to save as. Is
there any way in Excel or Word that I can automate this process?

  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Saving a cell name as a word doc

You are very welcome
--
Gary''s Student


"LDBlanes" wrote:

Thanks it works like a charm.

"Gary''s Student" wrote:

Say we have three names in A1 thru C1:

Firstfl
Secondfl
Thirdfl

First put a dummy name in D1. The enter and run this macro:


Sub Macro1()
Dim s As String
Dim i As Integer
For i = 1 To 4
s = Cells(i, 1).Value
fname = "C:\" & s & ".txt"
ActiveWorkbook.SaveAs Filename:= _
fname, FileFormat:= _
xlText, CreateBackup:=False
Next
x = Shell("cmd.exe /c rename C:\*.txt *.doc", 1)
End Sub

The For loop creates a set of .txt files and the Shell command renames them
as .doc. You will have three .doc files as a result.


You can increase from three to any number. The extra dummy entry in needed
to insure the last real entry gets renamed.
--
Gary''s Student....gsnu02012006


"LDBlanes" wrote:

I have a list of cells in an excel spreadsheet that I want to use to create
separate word documents from a generic word document.

right now I'm copying the cell name switching to Word opening file Save as
and pasting the name.

It doesn't take long but I've got over a thousand names to save as. Is
there any way in Excel or Word that I can automate this process?

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
Excel 2003 Word Wrap Problem within cell Dan S. Excel Discussion (Misc queries) 1 October 17th 05 03:54 PM
delete cell that doesn't contain a specific word [email protected] Excel Discussion (Misc queries) 1 October 12th 05 05:54 AM
Number in cell convert in word Rajiul Excel Worksheet Functions 2 October 5th 05 08:47 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Can not see all of a pasted paragraph from Word in a cell. Kat Excel Discussion (Misc queries) 2 December 23rd 04 06:37 PM


All times are GMT +1. The time now is 04:46 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"