Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Macro - I Think?
My need should be very elementary for an Excel savvy person. Obviously I'm not that savvy. Having said that...here's my dilemna. I have two columns in one spreadsheet with various columns linked t another spreadsheet. One column (Column B) in one of the spreadsheet calculates a value from the other spreadsheet. Column A has a constant number that was originally keyed in. All I need to do is test the following: IF COLUMN B COLUMN A, COPY THAT VALUE TO COLUMN A. IF COLUMN B < COLUMN A, DO NOT REPLACE THE VALUE IN COLUMN A. IF COLUMN B = COLUMN A, DO NOT REPLACE THE VALUE IN COLUMN A Your help will be greatly appreciated -- vinclan ----------------------------------------------------------------------- vinclanz's Profile: http://www.excelforum.com/member.php...fo&userid=1459 View this thread: http://www.excelforum.com/showthread.php?threadid=26221 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple Macro - I Think?
On Tue, 21 Sep 2004 17:39:02 -0500, vinclanz
wrote: My need should be very elementary for an Excel savvy person. Obviously, I'm not that savvy. Having said that...here's my dilemna. I have two columns in one spreadsheet with various columns linked to another spreadsheet. One column (Column B) in one of the spreadsheets calculates a value from the other spreadsheet. Column A has a constant number that was originally keyed in. All I need to do is test the following: IF COLUMN B COLUMN A, COPY THAT VALUE TO COLUMN A. IF COLUMN B < COLUMN A, DO NOT REPLACE THE VALUE IN COLUMN A. IF COLUMN B = COLUMN A, DO NOT REPLACE THE VALUE IN COLUMN A. Your help will be greatly appreciated. ==================== Sub BgtA() Dim rg As Range Dim c As Range Set rg = [B1:B100] 'set this to the appropriate range of B For Each c In rg If c.Value c.Offset(0, -1).Value Then c.Offset(0, -1).Value = c.Value End If Next c End Sub ===================== --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with simple macro | Excel Discussion (Misc queries) | |||
Need Simple Macro | New Users to Excel | |||
Can't get simple macro to run | Excel Worksheet Functions | |||
simple macro | Excel Programming | |||
Simple macro - help please!! | Excel Programming |