ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting Cell entries then save and overwrite template (https://www.excelbanter.com/excel-programming/301731-deleting-cell-entries-then-save-overwrite-template.html)

RPIJG[_52_]

Deleting Cell entries then save and overwrite template
 
I'd like to be able to delete the entries in certain cells, then sav
the file as a template (overwriting an existing template), that wa
some information I have entered will be saved in the template whil
other information is removed. How would I go about doing this

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


Tom Ogilvy

Deleting Cell entries then save and overwrite template
 
Open the workbook you want to use, make the changes, do File = Save As,
specify the name of the old template and specify file type in the dropdown
as .xlt.

--
Regards,
Tom Ogilvy

"RPIJG " wrote in message
...
I'd like to be able to delete the entries in certain cells, then save
the file as a template (overwriting an existing template), that way
some information I have entered will be saved in the template while
other information is removed. How would I go about doing this?


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




RPIJG[_53_]

Deleting Cell entries then save and overwrite template
 
ok, that answers my question but I didn't qualify my question wel
enough, I'd like to do this programmatically, sorry

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


Tom Ogilvy

Deleting Cell entries then save and overwrite template
 
sPath = "C:\Myfiles\"
ActiveWorkbook.Saveas Filename:=sPath & _
"MyOldTemplate.xlt", FileFormat:=xltemplate

--
Regards,
Tom Ogilvy

"RPIJG " wrote in message
...
ok, that answers my question but I didn't qualify my question well
enough, I'd like to do this programmatically, sorry.


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




RPIJG[_54_]

Deleting Cell entries then save and overwrite template
 
and for deleting cell contents, I was using this


Code
-------------------
Range("D13:H13").Select
Selction.ClearContent
-------------------


that I captured using the macro recorder, but I get an error sayin
object required or something of the like

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


Tom Ogilvy

Deleting Cell entries then save and overwrite template
 
for your existing code, Selection is misspelled

you could just do

Range("D13:H13").Clearcontents

--
Regards,
Tom Ogilvy


"RPIJG " wrote in message
...
and for deleting cell contents, I was using this


Code:
--------------------
Range("D13:H13").Select
Selction.ClearContents
--------------------


that I captured using the macro recorder, but I get an error saying
object required or something of the like.


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





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

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