Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.scripting.vbscript,microsoft.public.dotnet.languages.vb,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to delete the content of Excel cells from VBS script?

I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia

  #2   Report Post  
Posted to microsoft.public.scripting.vbscript,microsoft.public.dotnet.languages.vb,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default How to delete the content of Excel cells from VBS script?

Hi,

What does '3,6 .... 3,18' mean? Are you say you want to delete all values in
the range 3.6 to 3.18?

Mike

"Claudia d'Amato" wrote:

I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to delete the content of Excel cells from VBS script?


"Claudia d'Amato" wrote in message
...
I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia



create a Macro in Excel.

this is a very basic example that sticks "hello in rows 2 to 20 of column A.

For i = 2 To 20

Range("A" & i).Value = "hello"

Next



Now if I wanted to blank this range, I'd just change the line to this.

Range("A" & i).Value = ""

Changing all the values to blank.
Just play about with it until you get what you want.

Dave

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to delete the content of Excel cells from VBS script?

Does this mean Row 3, column 6 to Row 3, column 18?

And you really mean a VBS script?

If yes to both, then this worked ok for me:

================

Dim xlApp
Dim xlWks

Set xlApp = CreateObject("Excel.application")
'xlApp.Visible = True
Set xlWks = xlApp.Workbooks.Open("C:\book1.xls").Worksheets(1)

xlWks.Range("F3").Resize(1, 13).ClearContents

xlWks.Parent.Close True

xlApp.Quit

Set xlWks = Nothing
Set xlApp = Nothing

=================
It's nice to see what's happening when you're debugging. That's why I kept the
..visible line in the pasted code.


Claudia d'Amato wrote:

I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.scripting.vbscript,microsoft.public.dotnet.languages.vb,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to delete the content of Excel cells from VBS script?

i guess she means X,Y so third column , sixth cell and cell eighteen



"Mike H" schreef in bericht
...
Hi,

What does '3,6 .... 3,18' mean? Are you say you want to delete all values
in
the range 3.6 to 3.18?

Mike

"Claudia d'Amato" wrote:

I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default How to delete the content of Excel cells from VBS script?

try
range(cells(3,6),cells(3,18)).clearcontents
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Claudia d'Amato" wrote in message
...
I would like to delete the current content/value of the cells

3,6 .... 3,18

How can I do this within a *.vbs script?

Claudia


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
how to delete part of the content on multiple cells in excel? Luis Excel Discussion (Misc queries) 3 May 17th 23 07:42 PM
How to delete the content of Excel cells from VBS script? Claudia d'Amato Excel Discussion (Misc queries) 2 June 21st 08 12:55 PM
How do I delete only the content of cells that are NOT protected? DrDisk7 Excel Discussion (Misc queries) 1 May 17th 08 04:38 PM
VBA script to delete content in merged cells. Calle Excel Programming 2 July 7th 06 03:02 AM
how to delete duplicated content from 2 cells lucent88 Excel Worksheet Functions 2 October 12th 05 10:57 PM


All times are GMT +1. The time now is 07:26 PM.

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

About Us

"It's about Microsoft Excel"