Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell values copied!!


i have 2 columns - W and F
i need some type of macro that if a cell in W is greater than ""
cell in F, then F's value will automatically appear in W.

example:

w2 is 40
f2 is 30

therefore w2 should become 40

the W column is already filled and i'm filling in F cell by cell fro
outside info.

also, the cells are compared to their "rows" only meaning w2 = f2 an
so on, not w2 = f5, etc...

the macro doesn't have to loop as i type in column f... meaning i'll b
very happy w/ a macro that i can just run once when i feel like it an
it'll just take care of the 2 columns for me. but either will do...

thanks

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default cell values copied!!

What you wrote and what you said in your example aren't
quite the same, but I think I am reading your question
correctly. If W is greater than F, put the value of F
into W?

If you use the IF command in column W, it will be quite
easy.

Your formula will look like:

=IF(W2F2,F2,W2)

This formula says that if W2 is greater than F2, Excel
will put the value of F2 into cell W2. Otherwise, it
will keep the original value of W2 in the cell.



-----Original Message-----

i have 2 columns - W and F
i need some type of macro that if a cell in W is greater

than "" a
cell in F, then F's value will automatically appear in W.

example:

w2 is 40
f2 is 30

therefore w2 should become 40

the W column is already filled and i'm filling in F cell

by cell from
outside info.

also, the cells are compared to their "rows" only

meaning w2 = f2 and
so on, not w2 = f5, etc...

the macro doesn't have to loop as i type in column f...

meaning i'll be
very happy w/ a macro that i can just run once when i

feel like it and
it'll just take care of the 2 columns for me. but either

will do...

thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell values copied!!


for i = 1 to range.[w65536].End(xlUp).Row step 1
if range("w" & i ).value range("f" & i).value then
range("f" & i).value = range("w" & i).value
end if
next i



' range.[w65536].End(xlUp).Row gets last row in column W that has a
entr

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell values copied!!


thanks a lot - just what i was looking for

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cell values copied!!

Sub UpdateW()
for each cell in Range(cells(1,"W"),Cells(rows.count,"W").End(xlup) )
if cells(cell.row,"F").Value < cell.Value then _
cell.Value = cells(cell.row,"F").Value
Next
End Sub

--
Regards,
Tom Ogilvy


"aapp81" wrote in message
...

i have 2 columns - W and F
i need some type of macro that if a cell in W is greater than "" a
cell in F, then F's value will automatically appear in W.

example:

w2 is 40
f2 is 30

therefore w2 should become 40

the W column is already filled and i'm filling in F cell by cell from
outside info.

also, the cells are compared to their "rows" only meaning w2 = f2 and
so on, not w2 = f5, etc...

the macro doesn't have to loop as i type in column f... meaning i'll be
very happy w/ a macro that i can just run once when i feel like it and
it'll just take care of the 2 columns for me. but either will do...

thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cell values copied!!

Sub UpdateW()
for each cell in Range(cells(1,"W"),Cells(rows.count,"W").End(xlup) )
if not isempty(cells(cell.row,"F")) then
if cells(cell.row,"F").Value < cell.Value then _
cell.Value = cells(cell.row,"F").Value
End If
Next
End Sub

Probably should check to make sure F has a value.

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Sub UpdateW()
for each cell in Range(cells(1,"W"),Cells(rows.count,"W").End(xlup) )
if cells(cell.row,"F").Value < cell.Value then _
cell.Value = cells(cell.row,"F").Value
Next
End Sub

--
Regards,
Tom Ogilvy


"aapp81" wrote in message
...

i have 2 columns - W and F
i need some type of macro that if a cell in W is greater than "" a
cell in F, then F's value will automatically appear in W.

example:

w2 is 40
f2 is 30

therefore w2 should become 40

the W column is already filled and i'm filling in F cell by cell from
outside info.

also, the cells are compared to their "rows" only meaning w2 = f2 and
so on, not w2 = f5, etc...

the macro doesn't have to loop as i type in column f... meaning i'll be
very happy w/ a macro that i can just run once when i feel like it and
it'll just take care of the 2 columns for me. but either will do...

thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cell values copied!!

are you suggesting intentional circular references or you just don't know?
If you enter a formula in W, how does W get a value to start with?

--
Regards,
Tom Ogilvy

"Jeff" wrote in message
...
What you wrote and what you said in your example aren't
quite the same, but I think I am reading your question
correctly. If W is greater than F, put the value of F
into W?

If you use the IF command in column W, it will be quite
easy.

Your formula will look like:

=IF(W2F2,F2,W2)

This formula says that if W2 is greater than F2, Excel
will put the value of F2 into cell W2. Otherwise, it
will keep the original value of W2 in the cell.



-----Original Message-----

i have 2 columns - W and F
i need some type of macro that if a cell in W is greater

than "" a
cell in F, then F's value will automatically appear in W.

example:

w2 is 40
f2 is 30

therefore w2 should become 40

the W column is already filled and i'm filling in F cell

by cell from
outside info.

also, the cells are compared to their "rows" only

meaning w2 = f2 and
so on, not w2 = f5, etc...

the macro doesn't have to loop as i type in column f...

meaning i'll be
very happy w/ a macro that i can just run once when i

feel like it and
it'll just take care of the 2 columns for me. but either

will do...

thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cell values copied!!

if you are talking about mudraker's code

you said:
need some type of macro that if a cell in W is greater than "" a
cell in F, then F's value will automatically appear in W.


As written, W's value appears in F.

--
Regards,
Tom Ogilvy


"aapp81" wrote in message
...

thanks a lot - just what i was looking for!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
Copied Graph changes values Keith H[_2_] Charts and Charting in Excel 0 February 9th 09 12:38 PM
Copied formula produces unexpected copied results Robert New Users to Excel 1 December 5th 08 04:11 PM
values not showing for copied formulas Jeanne L Excel Worksheet Functions 2 August 12th 07 11:03 PM
copied formulas paste as values Trev Excel Discussion (Misc queries) 2 February 11th 06 05:09 AM
how do I convert copied Text numbers into values in Excel? MOE Excel Worksheet Functions 1 June 14th 05 06:03 AM


All times are GMT +1. The time now is 12:28 AM.

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"