Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Enter value zero into all cells in multiple ranges?

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Enter value zero into all cells in multiple ranges?

Fhi
probably the simplest way would be this
Sub zapitzero()
Range("A2,A2,G2,A4,E4,f4,A6:A8").Value = 0
End Sub

Add/remove cell references to suit.
you could attach the macro to a custom icon or drop a command button on the
sheet.
Regards
FSt1

"Al" wrote:

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?

  #3   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Enter value zero into all cells in multiple ranges?

Wow, that was quick! I'm not too familiar with macros, but I'm sure we can
work it out!
How do I drop a command button to the spreadsheet?

"FSt1" wrote:

Fhi
probably the simplest way would be this
Sub zapitzero()
Range("A2,A2,G2,A4,E4,f4,A6:A8").Value = 0
End Sub

Add/remove cell references to suit.
you could attach the macro to a custom icon or drop a command button on the
sheet.
Regards
FSt1

"Al" wrote:

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Enter value zero into all cells in multiple ranges?

hi
what version xl do you have?
2003
http://www.mrexcel.com/tip068.shtml
2007
http://office.microsoft.com/en-us/ex...366761033.aspx

it's pretty basic. if you don't like the command button, you could use a
label. they are some times more versital than button in that you can fit them
over a cell easier. the proceedure for labels and command button are about
the same.
the macro would go into a standard module
and you might want to stroll through here too.
http://www.mvps.org/dmcritchie/excel/getstarted.htm

regards
FSt1

"Al" wrote:

Wow, that was quick! I'm not too familiar with macros, but I'm sure we can
work it out!
How do I drop a command button to the spreadsheet?

"FSt1" wrote:

Fhi
probably the simplest way would be this
Sub zapitzero()
Range("A2,A2,G2,A4,E4,f4,A6:A8").Value = 0
End Sub

Add/remove cell references to suit.
you could attach the macro to a custom icon or drop a command button on the
sheet.
Regards
FSt1

"Al" wrote:

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?

  #5   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Enter value zero into all cells in multiple ranges?

Am using Office Professional 2003 on MS XP.

"FSt1" wrote:

hi
what version xl do you have?
2003
http://www.mrexcel.com/tip068.shtml
2007
http://office.microsoft.com/en-us/ex...366761033.aspx

it's pretty basic. if you don't like the command button, you could use a
label. they are some times more versital than button in that you can fit them
over a cell easier. the proceedure for labels and command button are about
the same.
the macro would go into a standard module
and you might want to stroll through here too.
http://www.mvps.org/dmcritchie/excel/getstarted.htm

regards
FSt1

"Al" wrote:

Wow, that was quick! I'm not too familiar with macros, but I'm sure we can
work it out!
How do I drop a command button to the spreadsheet?

"FSt1" wrote:

Fhi
probably the simplest way would be this
Sub zapitzero()
Range("A2,A2,G2,A4,E4,f4,A6:A8").Value = 0
End Sub

Add/remove cell references to suit.
you could attach the macro to a custom icon or drop a command button on the
sheet.
Regards
FSt1

"Al" wrote:

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?

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
Counting Criteria in Cells in Multiple Ranges WalterK Excel Worksheet Functions 4 May 20th 08 03:33 AM
Can I enter/sort multiple data within cells of a column? Greg Excel Discussion (Misc queries) 1 December 26th 07 04:57 PM
Enter multiple numbers in a cell so total shows when enter keypres newbie Excel Worksheet Functions 2 August 19th 07 12:23 PM
enter data once... copy to multiple cells on other worksheets Larry G Excel Discussion (Misc queries) 4 January 3rd 07 06:13 PM
Is there way to enter multiple values into excel cells w/ a form? grassfed Excel Discussion (Misc queries) 1 June 22nd 05 05:26 PM


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