Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copied Graph changes values | Charts and Charting in Excel | |||
Copied formula produces unexpected copied results | New Users to Excel | |||
values not showing for copied formulas | Excel Worksheet Functions | |||
copied formulas paste as values | Excel Discussion (Misc queries) | |||
how do I convert copied Text numbers into values in Excel? | Excel Worksheet Functions |