PC Review


Reply
Thread Tools Rate Thread

how do i get a column format to follow me from one cell to another

 
 
Graphically Challenged
Guest
Posts: n/a
 
      2nd Apr 2009
As I go through my spreadsheet I am calculating "max" and "min" values. When
I decide a column to work in I want to calculate the value and then format
the column to a 4-point decimal value "0.0000". I don't know in advance
which column I need to work in, but when I find one I want to perform those
two operations. I'm trying to set up a macro that is will be achored to the
current column I am working in. How can I do that?

Thanks!

 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      2nd Apr 2009
Give this code a try...

Sub Test()
With ActiveCell.EntireColumn
Min = WorksheetFunction.Min(.Cells)
Max = WorksheetFunction.Max(.Cells)
.NumberFormat = "0.0000"
End With

' You didn't say what you wanted to do
' with Min, Max, so I just show them
MsgBox Min & " // " & Max
End Sub

Just activate any cell in the column and then run the code.

--
Rick (MVP - Excel)


"Graphically Challenged" <(E-Mail Removed)>
wrote in message news22EA845-18C1-4CE2-9B20-(E-Mail Removed)...
> As I go through my spreadsheet I am calculating "max" and "min" values.
> When
> I decide a column to work in I want to calculate the value and then format
> the column to a 4-point decimal value "0.0000". I don't know in advance
> which column I need to work in, but when I find one I want to perform
> those
> two operations. I'm trying to set up a macro that is will be achored to
> the
> current column I am working in. How can I do that?
>
> Thanks!
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make a format to follow the cell Darren Microsoft Excel Misc 3 18th Aug 2009 02:06 PM
conditional cell format based on cell in same row, previous column =?Utf-8?B?dGFtaWx1Y2hp?= Microsoft Excel Worksheet Functions 7 3rd May 2006 04:11 PM
New column based on row cell format peteracain Microsoft Excel Misc 1 8th Aug 2005 01:37 PM
Format cell in column B based on value in the next cell (column c) =?Utf-8?B?Tmljb2xl?= Microsoft Excel Misc 7 18th May 2005 10:19 PM
to follow a particular cell format ronnieseah Microsoft Excel Worksheet Functions 13 4th Jun 2004 02:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:11 PM.