|
Reverse Cell Contents (Mirror)
This macro will completely reverse the contents of any cell. This means that if you have a cell which reads " My Text" and you run this macro on that cell, it will then read " txeT yM".
This macro will not work on cells which contain formulas. It will only work on cells that contain strictly text and numbers.
Run this macro on a selection of cells in a worksheet. This means that you select any number of cells and then run this macro and it will reverse the contents of every cell which you selected.
Where to install the macro: Module
Reverse Cell Contents (Mirror)
Sub Reverse_Cell_Contents()
If Not ActiveCell.HasFormula Then
sRaw = ActiveCell.Text
sNew = ""
For j = 1 To Len(sRaw)
sNew = Mid(sRaw, j, 1) + sNew
Next j
ActiveCell.Value = sNew
End If
End Sub
How to Install the Macro
- Select and copy the text from within the grey box above.
- Open the Microsoft Excel file in which you would like the Macro to function.
- Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.
Or For other ways to get there, Click Here.
For Excel Versions Prior to Excel 2007 Go to Tools > Macros > Visual Basic Editor
For Excel 2007 Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic
- On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.
- If the Macro goes in a Module, Click Here, otherwise continue to Step 8.
- Go to the menu at the top of the window and click Insert > Module
- Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.
- Go to Step 8.
- If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Then, at the bottom of the list that appears, double-click the ThisWorkbook text.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Go to Step 8.
- If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.
- Go to Step 8.
- Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.
- You are now ready to run the macro.
Similar Helpful Excel Resources
Please-What is the formula for a cell that is a mirror to the bottom cell of a column that moves with new data to the next down cell.
In other words, I want to follow the cell to its new location which is one cell below the original cell and to do this everytime the cell moves down. Thank you.
Hi -
I am trying to write a formula to reverse data in a cell.
Basically I am converting a number to hex then I want to take that hex string and reverse it.
So it would be something like this my original number is 400001001 my hex number would be 17D787E9 because I am only allowing it to show 8 characters. I want to reverse the 17D787E9 to read 9E787D71.
My question is:
How can I reverse that cell?
I have searched google and this forum and can't seem to figure it out.
I am sure I could do it in VB but I don't know any VB code.
Thanks for your help!
I have a name convention in one cell that has the last name first serperated by a comma with the first name last. How can I reverse this to show the first name first and the last name last in one cell?
All of the information is provided in one cell, which I can not change. If possible I would like to pull the names from the middle only (example: cell d11 only give me Adam Diaz and so on). Once I have pulled out the name, I would to reverse the name (example: Diaz Adam). Is this possible??
d11= ADIAZ01 Adam Diaz (adam.diaz)
d12= AELIZO02 Alejos Elizondo (alejos.elizondo)
d13= BDELUN00 Bobby Deluna (bobby.deluna)
d14= BFOREM00 Bud Foreman (bud.foreman)
d15= BGREGG00 Billy Gregg (billy.gregg1)
d16= CGREEN06 Christopher Greenwood (christopher.greenwood)
d17= CGREEN08 Cheryl Green (cheryl.l.green)
d18= DDOWNS01 Dickie Downs (dickie.r.downs)
d19= DFLORE03 Daniel Flores (daniel.flores3)
d20= DMENDE01 Donald Mendez (donald.mendez)
d21= DMORAL01 David Morales (david.morales4)
d22= DRODRI07 Domingo Rodriguez (domingo.rodriguez)
d23= DWASHA00 Daniel Washa (daniel.washa)
d24= EBROOK02 Earl Brooks (earl.brooks1)
d25= ECARRE00 Edelmira Carreon (edelmira.carreon)
Hi
I'm trying to do two things. One is very simple, and not ideal, the other perhaps slightly harder, but performs the same task as task one much more efficiently.
If I have fill out a few rows in Sheet 1 of a workbook, I'd like the ability to also show that information on Sheet 2.
I've tried entering =CELL(customcellrangename) into an individual cell of Sheet 2, and =(customcellrangename), but in response to either I get #VALUE!.
I've also tried entering =(customercellname) into a particular cell, and can see when I'm referencing an individual cell rather than a cell range (i.e. a selection that includes a few columns and rows) this works fine, I don't understand how to do it with a range though.
That's the simple version, I'm probably just using some syntax wrong.
What I'd really like to do is this:
In Sheet 1 I have rows and rows of data.
In Sheet 2, I want to display the entirety of any row containing the words "Action Required" in Column D. These words will not be mispelt, abbreviated etc so Excel will be able to find them if only I knew how to ask it to look!
To futher complicate matters, data from Sheet 3, Sheet 4 etc will need to be displayed aswell, and I will need some way of telling it apart, so I need to insert the Sheet Name into Column A, preceding each individual row of data.
Like I say, I'm sure I've done this before, but it was so many years ago I've either forgotten or...?
So thanks for any assistance you can offer
I have a spreadsheet with 5 tabs - MASTER, TED, CHRIS, MIKE, TIM. I've been tasked with finding a way to link any formatting changes from the four name tabs to the master tab. In other words, if the cell A3 on the TED tab is changed to red, the master would reflect that change.
In addition, there needs to be some sort of hierarchy to the changes. Changes made on MIKE would override changes on TIM, changes on CHRIS would override both MIKE and TIM, while changes on TED would override the other three.
Thanks in advance for any help you may be able to provide!
Rob
Good evening,
I would like, using a macro to reverse the contents of a column, ex. in a column which is the 1st cell A1 whose name is "FirstCell", and the last cell A5 whose name is "LastCell":
1
2
3
4
5
and I get :
5
4
3
2
1
Thank you in advance for any suggestions.
I need help!
I would like to instantly mirror any selected cell within a specific column into another specified cell.
Example:
If A1 has the value 4, A2 has the value 6, A3 has 7, A4 has 9, and I click on those cells in the order above, I would like to see the cell I specify show the same value when I've selected (clicked on) them.
Heeelp!!
Thanx in advance..
A macro was submitted in a similar thread, but I have a slightly different problem. I have empty cells, A1:A10, and in cells C1:C10 I have data. If A1 is selected, I would like to be able to click on any cell in colum C and that
info then appears in A1. Then I will select A2, and again, click on any cell
in C1:C10 and that appears in A2 and so on. I do not want cells A1 etc. to
change once populated. This can be a macro as well. Thanks!
Hi,
I'm trying to flip a cell in excel. In this cell I have a sequence of numbers, in this case ACTG for example (this sequence will vary in length in different cells). I want to mirror this: ACTG will give as an output GTCA. is there an easy way of doing this?
|
|