Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I want to swap values of two cells. can anyone help me on that? Eg. Cell A1
contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Select cell A1. Type in 100. Hit Enter.
Same process for cell A2. "Gary" wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Nice joke JMB, I have 5000 cells to swap.
any idea? "JMB" wrote in message ... Select cell A1. Type in 100. Hit Enter. Same process for cell A2. "Gary" wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Gary Wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks GaryHi Gary, Something on the order of this work? Of course change tye ranges. Code: -------------------- Sub SwapCells() Dim x As Integer x = Range("a5").Value Range("a5").Value = Range("a6").Value Range("a6").Value = x End Sub -------------------- -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=566905 |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks a ton Desert. Its working fine. How do i add more ranges..can i just
write x=range("a5:a2000") ? "Desert Piranha" <Desert.Piranha.2buhdn_1154408103.6074@excelforu m-nospam.com wrote in message news:Desert.Piranha.2buhdn_1154408103.6074@excelfo rum-nospam.com... Gary Wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks GaryHi Gary, Something on the order of this work? Of course change tye ranges. Code: -------------------- Sub SwapCells() Dim x As Integer x = Range("a5").Value Range("a5").Value = Range("a6").Value Range("a6").Value = x End Sub -------------------- -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=566905 |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Gary Wrote: Thanks a ton Desert. Its working fine. How do i add more ranges..can i just write x=range("a5:a2000") ?Hi Gary, Are you looking for columns? Like swap Column A and Column B. Sub SwapCells() Dim x As Integer ' Use this line for numbers or ' Dim x ' Use this line for text and numbers x = Range("a5:a2000").Value Range("a5:a2000").Value = Range("b5:b2000").Value Range("b5:b2000").Value = x End Sub -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=566905 |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi!
Try this: =OFFSET(A1,1*IF(MOD(ROWS($1:1),2),1,-1),,) Copy down as needed. After you get everything flipped you can convert the formulas to constants by: Selecting the range of formulas Goto EditCopy Then, EditPaste SpecialValuesOK Then, you can delete the original data if desired. Biff "Gary" wrote in message ... I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
USE "Ctrl" + "x" on The Source and "Ctrl" + "+" on the desteney
"Gary" wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Eli,
Thanks, it is great. Shail Eli Shichrur wrote: USE "Ctrl" + "x" on The Source and "Ctrl" + "+" on the desteney "Gary" wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
And exactly where in your original post did you state that you had 5000
cells, pray tell. "Gary" wrote: Nice joke JMB, I have 5000 cells to swap. any idea? "JMB" wrote in message ... Select cell A1. Type in 100. Hit Enter. Same process for cell A2. "Gary" wrote: I want to swap values of two cells. can anyone help me on that? Eg. Cell A1 contains the value 20 & cell A2 contains the value 100. I want 100 on A1 & 20 on A2. Thanks Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
There should be a swap function for 2 values | Excel Discussion (Misc queries) | |||
Swap the X and Y axes | Charts and Charting in Excel | |||
Text Strings Swap | Excel Worksheet Functions | |||
Swap contents of two cells | Excel Discussion (Misc queries) | |||
Swap data from one cell to another | Excel Worksheet Functions |