Is there an easy way to swap the contents of two cells in Excel?

I think the subject says it all...
0
Yond (1)
7/23/2005 12:07:02 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
654 Views

Similar Articles

[PageSpeed] 59

=?Utf-8?B?Ti5CLiBZb25k?= <N.B. Yond@discussions.microsoft.com> wrote in 
news:4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com:

> I think the subject says it all...
> 

You could add a button to the sheet with following code behind it:

Private Sub CommandButton1_Click()
    cel1 = InputBox("First cell?")
    cel2 = InputBox("Second cell?")
    c1 = Range(cel1).Value
    c2 = Range(cel2).Value
    Range(cel1).Value = c2
    Range(cel2).Value = c1
End Sub

You will be asked for the 2 cell addresses and the contents will be 
swapped.
0
Dodo
7/23/2005 12:37:23 PM
manually???

Edit|copy one cell
select a helper cell and edit|paste special|values

edit|copy the second cell
select the first cell
edit|paste special|values

select the helper cell
edit|copy
select the second cell
edit|paste special|Values

clean up that helper cell.

N.B. Yond wrote:
> 
> I think the subject says it all...

-- 

Dave Peterson
0
petersod (12004)
7/23/2005 12:38:45 PM
N. B.,

You'd like to select the two cells, click the Swap Button, and presto, 
they're swapped.  Unfortunately, there ain't such a button.

A macro could do it..  Then there could be a swap button.  Or a keyboard 
shortcut.  Or a menu item.  If you're interested, post back.  We'll write it 
for you.  What do you want to do with formatting?  Leave in the original 
locations?  Or swap that too?  What?  Should formula cell references to 
these cells get swapped, or remain with the original locations?
--
Earl Kiosterud
www.smokeylake.com

"N.B. Yond" <N.B. Yond@discussions.microsoft.com> wrote in message 
news:4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com...
>I think the subject says it all... 


0
someone798 (944)
7/23/2005 2:04:20 PM
Select cell'A', Cut.
Drag cell 'B' to cell 'A', click OK to replace content.
Click cell 'B', Paste.

HTH |:>)


On 7/23/05 8:07 AM, in article
4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com, "N.B. Yond" <N.B.
Yond@discussions.microsoft.com> wrote:

> I think the subject says it all...

0
7/31/2005 8:29:25 PM
Reply:

Similar Artilces:

every email is sent to two recipients
Just changed over from an eval copy of sbs2003 to a licensed copy and have been chasing several problems that never showed up in the original setup. Now every email sent to users mailboxes has two recipients in the to: column the first is the legitimate user address and the second is 'IMB Recipient 1'. What is an 'IMB Recipient 1' and why is it getting added to the to: address column. Any help from http://groups.google.com/groups?as_q=IMB%20Recipient&safe=images&ie=ISO-8859-1&lr=&hl=en jjjj wrote: > Just changed over from an eval copy of sbs2003 to a li...

Any way to change the Desktop Icon?
I have tried the old right click and properties but nothing for changing the icon. Anyone assist these very old (81) drybones? thanks, DB What Desktop icon? The Windows Live Mail icon? Right Click | Properties | General Tab | Change Icon. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "drybones" <drybones@charter.net> wrote in message news:ePMchQqqKHA.5116@TK2MSFTNGP04.phx.gbl... >I have tried the old right click and properties but nothing for changing >the icon. > > Anyone assist these very old (81) drybon...

Large amount of text in cells
Hi, I am having a problem getting Excel to display all text in a cell. I am using Excel 97 and need the functionality to record large amounts of text, as well as the calculation capabilities. I know that Excel 97 will accept 32,000 characters in a cell and I am not using anywhere near this. When I enter my text, it is no longer displayed in the cell. It is there when I click on it but not when the cursor is in another cell. I attach a small file to explain what I mean. Thanks in advance, Patrick Please don't attach files - this is not a binary newsgroup. XL cells can contain 32767...

##### Date in Excel
Please can anyone help me. I Microsoft Office XP I had a very long list (about two thousand entries). Each entry had a date in column B Before I reformatted my PC I saved the document. When I put it back on my PC after the format all the dates in column B have changed to #######. If I point the mouse curser over each entry it shows the original date Can anyone PLEASE tell me is there a way to get thses dates back Many many thanks Mandy x "Mandy S" <mandyswallowsnospam@yahoo.co.uk> wrote in message news:dic346$8gj$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... > Please ca...

copying colored cells
Hi, I am trying to copy lots of cells to a new worksheet. These cells have their font color red.(they happen to be table names). Tables do not have standart rows, so i can use a for loop thing here:( or at least can image how to set it. All I want to scan just A column, find red colored text and copy the text to another workbook. Tried to to it manually but i happen to make mistakes:( ps:as these are the table rows, they only have data in their Ax cells. B,C,D.. are empty:) note: Cannot filter to sort them out cause i will copy the table footers, which contain prices. so ...

Linking cells between two workbooks
I would like to link cells in two workbooks such that whenever a change is made in the source workbook, the destination workbook cell changes as well. Seems like a simple task in the Help menu, and I followed the directions. However, although the value in the destination cell changes to the same value as in the source cell when I hit "Enter", it only works that initial time. If I go in and make a change subsequently to the source cell, the destination cell stays the same. If I click on the destination cell, the current value is shown in the formula field at the top, not th...

CRichEditCtrl contents from RTF file
Hi, I have a Wizard based application, in which I have some property pages. In one of the pages, I have a CRichEditCtrl, and I try to populate its contents from a RTF file. The porblem is, it works correctly if the RTF file is small (about 4-5 KB), but when I use a larger file, its contents either don't display at all, or gets truncated. The code is shown below. What can I do to show the entire contents of the RTF file in the control? Also, it should work for all languages - I have UNICODE defined in the project. m_RECtrl is the rich edit control. static DWORD CALLBACK...

OWA Question
Can anyone help me with this problem? We use Public Folders on our exchange server in order to have a central place to post info like programs, pricelists, telephone lists, etc. We have some external users who wish to use Outlook Web Access (OWA) in order to be able to view their mail. Because they're not in the USA, dialup is not an option for them. Because they're satellite connected, they cannot use VPN. The problem with it that we've seen is Public Folders (and forms), which are really 2 problems. First: The folders display fine. The contents of them, the dates, etc. sh...

Histogram in Excel
I have written a macro that uses the data-analysis tool to creat a histogram. It turns out too small and I have to manually enlarge it. I can't seem to do it in the macro, because one has to select thee chart and I can't figure out how to do this since it reuires a chart number to select it. And of course the number changes every time the macro is run. So my question is: In a VBA macro how do I select the only chart when I will not know it's number. Help will be appreciated. Thank you. Hi, Some like this will select the most recent chart object on the activesheet. Dim objCht...

Excel 2003 help doesn't work. I got both Excel 2003 and 2007 insta
I have both Excel 2003 and Excel 2007 installed. The Excel 2003 help doesn't work, but the Excel 2007 help works fine. When trying to open help in Excel 2003, the help window open, but it's all grey. ...

Best way to maintain back-up of e-mails and contact data?
Does anyone have experience in maintaining a good back-up routine for the data within Outlook for XP? I routinely back up all data files within my documents, but find it difficult to manage the data within Outlook gregg gaskins You can setup Outlook so its data files are in My Documents ilsrwy6 wrote: > Does anyone have experience in maintaining a good back-up routine > for > the data within Outlook for XP? I routinely back up all data files > within my documents, but find it difficult to manage the data within > Outlook > > gregg gaskins >-----Original Mess...

How can I change which cell is selected next, other than Down, Le.
I know there should be a simple answer to this question, but I can't find it on the "Help" menu. Hi Bethany tools / options / edit "move selection after enter" -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Bethany" <Bethany@discussions.microsoft.com> wrote in message news:50CD805D-F385-4457-9363-5C3A3EF7825D@microsoft.com... >I know there should be a simple answer to this question, but I can't find >it > on the "Help" menu. tools->options->edit and select one of...

Easiest Way to do this Importing method?
Hey guys- been searching for a while now, and all the posts are a little more complex than I think this needs to be. Can you help? Basically, I have a CSV file that I need to import into another 'Template' file. But- here's the key- not EVERY column in the CSV file needs to import into my template. Also, the columns in the CSV file are NOT in the same order they need to be in the Template file. So, I need to be able to pick and choose which columns import and go where. Does that make sense? Is there an easy 'import mapping' system to use or any other way to do this? ...

Comparing more than two variables
I have some research data I need to tally and chart. I am looking at a group of subjects that answered a 7-question test. I want to tally the responses, and tally the total instances of each one compared to the others (like how many answered yes to 1, 2, and 3 (or any other combination)). I know pivot tables can give me 2 variables and how many of each gave an answer, but I would like to do it for the whole test. Can anyone help me out? For instance, example questions could be (for simplicity sake): male or female: age (0-20, 21-30, 31-50, 50+): hair color (brown, black, blonde, or ...

Quickest way to add one more name to a rule?
In OL2003, I have created a rule that if a piece of email arrives from anyone on a certain list of people it automatically gets delivered to a special folder "Work email". Every once in a while, I get an email from someone who ought to be on that lsit, but isn't. So I go into Tools/Rules, find the rule, and manually ad their name to the ever-growing list. IS there an easier way to do this? Is there some way I can just drag their name to the list somewhere? (The closest I've been able to come to a shortcut is when the email is opened, go to Actions/Create Rule, and ...

Count worksheet with specific value in a cell
I was trying to locate (or simply count) from a list of 1000 excel workbooks (which may contain more than one worksheet) with a specific value in a cell. Say, the value "ak" in cell <R59>. Would anyone show me the way, please. Thanks! John Chow John, I took this code from Ron de Bruin's web site and changed a few lines. It goes through each Excel file in folder "C:\data" (change to fit) and counts how many values "AK" are found in cell R59 , sheet1 of each file. Go to Ron's web site for other macros to search workbooks: http://www.rondebruin...

Counting entries in two columns
Hello everyone, I have a training schedule spreadsheet consisting of 5018 rows of data. Column 'D' contains the title of the course each participant attended and in most cases this is duplicated on different rows. This indicates the number of participants that attended a particular course. Column 'E' contains the date the training course held. Some courses run 4 times in the year. I want to count the number of participants that attended each course on a particular day. Any advice would be welcomed. Thank you, Esther Hi I would use a pivot table for this. see the fo...

Merging Two Publisher 2003 doc togther
I have a magazine that i create in Publisher and i then get some more content in Publisher that is done by another colleague.. I always have to print it off speratley but was wondering if anyone knew if i could merge the two togther and print it out as one Using MS Publisher 2003 SP2 -- Matt Owner MSE IT www.mse-it.co.uk If it were me I'd make them both pdf files and then combine them with a pdf tools program. PDF-Tools http://www.docu-track.com/downloads/users/ It can be used with any pdf files. Also, their PDF-XChange is a great pdf converting program. -- Don Vancouver, USA ...

Turn off Assistance pane in Excel
How can I turn off the Assistance pane in Excel? Not sure what you're calling 'Assistance pane', but try this: Tools > Options > View Deselect 'Startup Task Pane' "Petra" wrote: > How can I turn off the Assistance pane in Excel? ...

search and return cell count
I have a list of dates. (certain dates are excluded). I need a formula that would perform like a datedif and lookup formula. Using two cell references, I need to be able to count the number of cells (dates) between the reference points in a formula. Sort of like a lookup formula that finds both values and returns the number of cells in between. ULTIMATELY: search list for value in a1, search list for value in a2, how many cells are in between any suggestions? thanx =SUMPRODUCT(--(C1:C100>=A1),--(C1:C100<=A2)) -- --- HTH Bob (there's no email, no snail mail, but somewher...

Proper way to enter debt accounts
I've been using Money 2002 for about a month now to track my savings and checking accounts. Now I'd like to enter the balances on my Car loan. What is the proper way of doing this so that I can use money to 1) Track the balances 2) Help give me some payment strategies to help me become debt fee faster? Two choices: 1) Create a Loan Account and schedule a series of Loan Payments. This will allow the payments to automatically include an interest component. 2) Create a Liability Account and schedule a series of Bills. You will have to manually enter the interest component o...

How do I transfer Outlook contents to new computer?
Hi, I have a new computer and need to transfer my outlook over from my laptop. Am using 2003, which is installed on my new computer also. I've been searching these q&a's, and see that I will need to "copy to a pst file"? What is this, where do I find it, and how to I execute it??? And if any of you clever people choose to help me, you will have to talk r-e-a-l-l-y s-l-o-w-l-y, as I'm very sorry, but I don't speak your language. -- Regards, Sarah See if this helps http://www.howto-outlook.com/howto/backupandrestore.htm "Sarah" <sarah@discus...

When I select "Open" from the "File" menu in Excel, I get only a .
When I select "Open" from the "File" menu in Excel, I get only a beep, no file selection window appears. All other function in Excel seem to work. Guess #1: http://support.microsoft.com/?kbid=308360 OFF2000: Error Messages Caused by Nimda Virus When You Open or Save Files in Office Programs Guess #2: Something has broken that option. You can reset the toolbar to see if that helps. tools|customize|toolbars tab select worksheet menubar click reset With #2, you'll have to re-do any customizations you've done to that toolbar. dan wrote: > > When I...

two letters upon another for math symbols
How is it possible to get two letters at the same place? I have to create math symbols with a dot or a dash on top of a letter. I know I can get these symbols whith shapes, but that is cumbersomely. I am looking for some deadkeys or a vba-macro. Most mathematical symbols are already available in the fonts symbol wingding wingding2 wingding3 and especially arial ms unicode check out: http://www.unicode.org/ -- Gary''s Student "xlstatik" wrote: > How is it possible to get two letters at the same place? > I have to create math symbols with a dot or a dash on top of...

display web pix in a cell
I want to display web pix in a xl cell, the cell has the url in it but I wat the pic it references to displsy Hi AFAIK this is not possible with Excel's build-in functions. You'll need VBA to achieve this -- Regards Frank Kabel Frankfurt, Germany dgates80 wrote: > I want to display web pix in a xl cell, the cell has the url in it > but I wat the pic it references to displsy ...