Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
chermaine
 
Posts: n/a
Default Syntax to set cells to be zero

Actually i have created a button for retreiving teh data (numerical
figure) from one worksheet to another worksheet but that requires some
addition and subtraction on the original value. I now would like to
make every "to be filled cells" to be "zero" which can help me to do
the subtraction later on. So I wonder if there is anyone can teach me
some the syntax for that operation. ( i would like to make a button to
set those cells zero first) Anyone please help!

  #2   Report Post  
Dave O
 
Posts: n/a
Default

Good morning, Chermaine-
Just to make sure I understand: you have a "Source" spreadsheet, and
you've written some code to pull data from the Source and write it to a
"Target" spreadsheet. But due to the nature of your application you
first need to set the Target cells to have a zero value before any of
this operation occurs. Is that about right?

I'm curious about the need to have a zero value inserted into the
target cells, because empty cells have effectively a zero value by
default. If you need those cells to *display* a zero value, you can
set that in advance using cell formatting. If you need to subtract
something from zero, you might instead multiply by -1.

To answer your question, the syntax to set a cell to zero is
ActiveCell.Value = 0
....which may or may not apply to your situation, because you may need
to set an entire range to zero. You may be able to have this or
similar code run in your existing macro; just place this code in such a
way as to run first, before the data retrieval code.

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
Fill cells from non-adjacent cells Abes Excel Discussion (Misc queries) 2 March 25th 05 01:15 PM
REVISED ?? - populate limited cells w/ set value Jane Excel Worksheet Functions 1 March 19th 05 02:29 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM


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