Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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
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
Help with simple macro Sam Commar Excel Discussion (Misc queries) 3 April 15th 08 04:30 PM
Need Simple Macro jreinert New Users to Excel 2 June 15th 06 03:58 PM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
simple macro Joe Excel Programming 2 July 16th 04 12:27 AM
Simple macro - help please!! Micheal Excel Programming 2 October 24th 03 04:30 PM


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