Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill cells from non-adjacent cells | Excel Discussion (Misc queries) | |||
REVISED ?? - populate limited cells w/ set value | Excel Worksheet Functions | |||
Convert data type of cells to Text,Number,Date and Time | Excel Worksheet Functions | |||
Convert data of cells to any type: Number, Date&Time, Text | Excel Discussion (Misc queries) | |||
Count number of shaded cells | Excel Discussion (Misc queries) |