Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Help w/ macro to zero hard keyed numbers

I want to write a macro that will search through a sheet and find numbers
that are hard coded, not the result of formulas, and the in that cell write a
blue 0.

The writing in blue is ancillary to the ability of finding the hard coded
numbers and zeroing them.
Is this possible? Thanks for the help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help w/ macro to zero hard keyed numbers

Mike,

Here is some code

Dim rng As Range

Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants)
With rng
.Value = 0
.Font.ColorIndex = 5
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Piazza" wrote in message
...
I want to write a macro that will search through a sheet and find numbers
that are hard coded, not the result of formulas, and the in that cell

write a
blue 0.

The writing in blue is ancillary to the ability of finding the hard coded
numbers and zeroing them.
Is this possible? Thanks for the help?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Help w/ macro to zero hard keyed numbers

This'll get text and number constants, though.

Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants, xlNumbers)

To the Original Poster. Be careful when you do this. It'll include all those
Header cells, too.


Bob Phillips wrote:

Mike,

Here is some code

Dim rng As Range

Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants)
With rng
.Value = 0
.Font.ColorIndex = 5
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)

"Mike Piazza" wrote in message
...
I want to write a macro that will search through a sheet and find numbers
that are hard coded, not the result of formulas, and the in that cell

write a
blue 0.

The writing in blue is ancillary to the ability of finding the hard coded
numbers and zeroing them.
Is this possible? Thanks for the help?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Help w/ macro to zero hard keyed numbers

Thanks Dave,

When i use this line the macro will not include cells that have a formula
but do not reference other cells, such as = 120+56. for my purposes i would
consider that a hard key cell. Is it possible to select these ones that dont
ahve references as well?

"Dave Peterson" wrote:

This'll get text and number constants, though.

Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants, xlNumbers)

To the Original Poster. Be careful when you do this. It'll include all those
Header cells, too.


Bob Phillips wrote:

Mike,

Here is some code

Dim rng As Range

Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants)
With rng
.Value = 0
.Font.ColorIndex = 5
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)

"Mike Piazza" wrote in message
...
I want to write a macro that will search through a sheet and find numbers
that are hard coded, not the result of formulas, and the in that cell

write a
blue 0.

The writing in blue is ancillary to the ability of finding the hard coded
numbers and zeroing them.
Is this possible? Thanks for the help?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help w/ macro to zero hard keyed numbers


"Mike Piazza" wrote in message
...
Thanks Dave,

When i use this line the macro will not include cells that have a formula
but do not reference other cells, such as = 120+56. for my purposes i

would
consider that a hard key cell.


Unfortunately, Excel does not.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Help w/ macro to zero hard keyed numbers


I found somewhere that you could exclude dates by going:

For Each Rng In Cells.SpecialCells(xlCellTypeConstants, xlNumbers)
If Not IsDate(Rng.Value) Then Rng.ClearContents
Next Rng

Can I combine this with the insert blue & 0 as below:

With rng
.Value = 0
.Font.ColorIndex = 5
End With

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
Convert hard keyed/formatted numbers to dates MarvInBoise Excel Worksheet Functions 4 November 14th 06 06:45 PM
re Macro - too hard for me !! Anthony Excel Discussion (Misc queries) 3 February 28th 05 05:11 AM
Macro - Too hard for me!! Anthony Excel Discussion (Misc queries) 3 February 27th 05 07:11 AM
Macro -Far too Hard for me !! Anthony Excel Worksheet Functions 1 February 27th 05 04:21 AM
Macro - Too hard for me!! Anthony Excel Discussion (Misc queries) 0 February 27th 05 12:55 AM


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