Superscript Subscript - Part Of A Cell - Using VBA
Apr 22, 2002
Is there a way to superscript or subscript only part of a cell's text? The forum below provides VBA to superscript an entire cell.
How about just part of a cell?
e.g. Say I type "The volume of the cylinder is 42 m3", the press the arrow key once (to have the cursor before 3, hold down shift, go forward to select 3. NOW, I want to run a macro or script to superscript the selected part of the text, in this case the 3.
http://www.mrexcel.com/board/viewtop...ic=856&forum=2
How about using an inputbox to choose part of the cell?
Or using an inputbox to ask you to choose the cell,
THEN counts number of characters,
THEN asks you where to start and stop the supercript or subscript,
THEN asked if you want to superscript or subscript
THEN asks if you want to superscript/subscript (depending on what was choosen) "selectect text"(have excel store the text part selected for formatting),
THEN carries it out?
Is this possible? I don’t know enough VBA to know.
Here's some code to get people started..
Range("A1").Select
ActiveCell.FormulaR1C1 = "m3" .........
View 9 Replies
ADVERTISEMENT
May 19, 2009
I have a scheduling spreadsheet that I designed for excel. It uses numbers as text and vlookup values instead of calculating actual time (its easier and saves space). I want it to look aesthetically pleasing:
630-230 (that is six-thirty until two-thirty)
7-315 (that is 7 o'clock until three-fifteen)
should look like this:
630- 230
7 - 315
How should the code be written so that if I write a string of text "xxx-xxx or x-xxx" the right parts get superscripted automatically.
notice that the first example has 3 digits before the hyphen and the second example has 1 digit before the hyphen. I need the vba code to work no matter which example is used.
View 9 Replies
View Related
Mar 18, 2013
When using format cells > number >custom I want to custom oC with the degree symbol in superscript. how to get superscript into the custom box? Also where is the superscript icon for the quick access toolbar in Excel?
View 3 Replies
View Related
Jan 22, 2010
I have an amount of text in my spreadsheet, which contains superscript numbers and I want to get rid of these numbers.
Is it possible to do this with a UDF or a macro?
I include a simple example spreadsheet with the situation as it is, and how I would have it.
View 2 Replies
View Related
Jul 17, 2014
I want to superscript the text with red color. But now only a active cell is change to superscript with red color after running the macro.
View 2 Replies
View Related
Jul 25, 2006
I have a cell (A1) that, depending on a choice made elsewhere in the workbook, will return A2, A3, A4, or A5, which are all formatted differently with superscripts. How do I get that formatting to copy over to A1 without having to manually copy and paste format from the appropriate cell? I have to do this for a range of cells (A1:A15) instead of simply one.
View 4 Replies
View Related
Jun 19, 2007
Is there anyway to superscript font in userform such cm2 (you know what I mean) instead of cm^2.
View 8 Replies
View Related
Jul 23, 2013
Text to column function. My database includes dates and names of medications separated with superscript numbers. The numbers are not fixed. So I need a separation between any superscript figures.
Example:
³4002/60/61³51³4002/50/11³gm³bat gm52 nanizon³מרוסק³ ³³006³4002/50/60³gm³stelbaT gm02 livomiS³³ ³³01³
The data is in reverse order but this was solved already.
View 1 Replies
View Related
Apr 2, 2008
Is it possible to make a macro that will go cell by cell and format the last number of the cell as subscript? Here's an example:
Brooks #1H 5Stewart #8H, #9H 8Stevenson D Unit #1H 2150,000 BblsStewart #8H, #9H 8Stevenson D Unit #1H 2Brooks #1H 5Stewart #8H, #9H 8Holasek #1H 5Brooks #1H 5Stewart #6H, #7H 8140,000 BblsRayburn Unit #5H, #6H, #12H 6160,000 BblsHolasek #1H 5450,000 BblsStewart #6H, #7H 8#N/ARayburn Unit #5H, #6H, #12H 6Stewart #6H, #7H 8Holasek #1H 5Rayburn Unit #5H, #6H, #12H 6Stewart #6H, #7H 8Holasek #1H 5
I would like ONLY the last NUMBER of the cell to be formatted as subscript. The cells with "Bbls" would be left as is.
View 9 Replies
View Related
Feb 16, 2010
I thought I had this solved but an inconsistency has shown up. I have a long list of chemical formulas that I want to format (partially) as subscript.
Basically what I need the macro to do is look at each character within a cell and check to see if it is numeric. If it is AND it follows a non-numeric character it should be formatted as subscript.
Examples
H2O the 2 should be subscript
H2SO4 the 2 and the 4 should be subscript
2CCl4 only the 4 should be subscript
View 2 Replies
View Related
Feb 16, 2010
I have a long list of chemical formulas that I want to format (partially) as subscript.
Basically what I need the macro to do is look at each character within a cell and check to see if it is numeric. If it is AND it follows a non-numeric character it should be formatted as subscript.
Examples
H2O the 2 should be subscript
H2SO4 the 2 and the 4 should be subscript
2CCl4 only the 4 should be subscript
CuSO4 - 5H2O
View 2 Replies
View Related
Jun 18, 2013
I have the folloing Sheets("Monday").Select.
I would like to link this to a cell in my excel sheet.
On Sheet 1 i have a folmular which gives me yesterdays day I would like to like this to the cell so i tryed this
Tabname = sheet1.cells(12, 9)
And I have change the above to Sheets(" & Tabname & ").select.
Its giving me a Subscript out of range error.
View 1 Replies
View Related
Feb 12, 2009
I'm creating a worksheet that gives a list of part numbers based on the product part code. In most cases I can use the following.
=LOOKUP(O6,{0,1,2,3,4},{"NONE (M25)","SMP-55-001","SMP-55-004","SMP-55-008","SMP-55-014"})
so this gives a part number depending on what number is placed in O6. What I need to do know is look at 2 different cells and for each combination of numbers give a different part number. so if A1 is 2 and B1 is 3 give a certain result.
View 3 Replies
View Related
Nov 18, 2008
Using the below formula. I know that I should get the result of 32 if I am dong this correctly (182 matches part 1 of which 32 match in part 2).
=SUMPRODUCT(--($A$1='7. PM BDE'! $J$3:$J$366))*(--('7. PM BDE'!$L$3:$L$366=1))
View 3 Replies
View Related
Feb 12, 2014
Is there any way to remove the first part of a string of text in a cell and save the second part?
The first part of the text string is a team code that has a variable number of numbers, capital letters and sometimes spaces. The second part of the text string is a variable number of words in a team name that all start with a capital letter and have lower case letters. Every line has a different team code and team name.
The original spreadsheet also has a column with just team code. Is there a way of using this column to "subtract" the team code from the text string to just leave the team name?
View 5 Replies
View Related
Feb 6, 2008
I have a sheet where i have many differently named areas (like state1_1 and state1_2) When I doubleclick on a cell then a macro should run with following criteria: 1) Macro will run if the doubleclicked cell is part of any range in the list. Here I mean that names of ranges which belong to that list start with word state (like state1_1 and state1_2). No other ranges should not be in that list. If the cell is not in the range that is part of the list, then nothing should happen.
View 2 Replies
View Related
Dec 10, 2008
I have a spreadsheet with 2 worksheets. On the first "active parts" I have a list of active part numbers and on the second "All Parts" I have all of the parts available.
I want to compare every part in the All Parts worksheet to see if the part number exists on the Active Parts sheet - if it's there, I would like it to return the value "Active" in column B in All Parts. I have a formula in column B in All Parts that seems to work for the first few, but as soon as it finds one that is active, the rest of the cells below all return "Active".
View 3 Replies
View Related
Aug 4, 2007
I have 2 basic parts to a Macro which need to be separated by a pause of 1 second, before proceeding to the next part of the macro. Then pause for 1 second, and loop.
Application.Wait is no good to me as the spreadsheet must remain live, editable, and receiving updates from an external program linked via DDE. Below is the ...
View 6 Replies
View Related
Jan 22, 2014
i have a column of data part number part text e.g 7w1,8b1 in the next column i want to write a function that will look at the other and dependant on whats in it place a word e.g. for 8b1 i need it to look at the "b" and enter beauvale if theres no "b" but a "w" enter wollaton, i have tried an if function and used "*b*" but it doesnt seem to like wildcards ....
View 9 Replies
View Related
Apr 18, 2013
I have some cells with text entered in column A.
These cells contain a time reference either in '09:30 - 16:30' format or just an 'AM/PM' format.
What I need to do is to populate column B with the part of the string that comes AFTER the times in the text (either in hh:mm format or AM/PM format)
Example
336 Data 2012 Classroom Induction 2012/08/28 09:30 - 16:30 data about this ------> data about this
336 Information about this 2013/04/04 09:00 - 13:00 Information 2 ------> Information 2
336 info CHS Suffolk 2013/05/07 PM DRC, BSE ------> DRC, BSE
364 information 2013/02/12 AM DRC, BSE ------> DRC, BSE
I cannot get this to work and cannot use Text To column as there is no character I can use to split it.
View 4 Replies
View Related
Nov 24, 2008
I need to find the "x" in range C2:C44 and replace it with a value (variable) specified in cell I2
The catch is that I then need to be ablt to change that character when I2 changes.
Coloum C
*VER
*T’x’STATUS
*ON
*OFF
*T’x’BANDS
EG
I2 - Variable = B
*T’x’STATUS will become *T’B’STATUS
I2 - Variable = A
*T’x’STATUS will become *T’A’STATUS
But " *OFF " should not change.
I can change *T’x’STATUS to *T’B’STATUS but then I can change *T’B’STATUS to *T’A’STATUS
Please see attached example file as it shows it better than I can explain it.
View 11 Replies
View Related
Aug 14, 2014
In one cell I have multiple value:09/16/2013, 09/16/2013, 09/16/2013, 10/15/2013
I want to use the first read which is 08/22/2013. Not always i have multiple dates in my table.This is part of code that I am working on.What I usually do, to get the last value when I have multiple reads is:
I have select the cell C1, the multiple reads(dates) are in the cell B1, so i need the last read(10/15/2013) ;i use this code:
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-1],10)+1"
SO now I want use the same logic but i want to take the first read/date. Also here the cell from where I want to get the value is selected.
Above the multiple reads were in the cell B1 and cell C1 was selected before performing the code, now the code is in the cell B1 and B1 is also selected.
I tried to do ActiveCell.FormulaR1C1 = "=Left(RC[-1],10)" but I rich the value in the cell on left which is A1. I want this for tomorrow since I have something to present.
View 1 Replies
View Related
Oct 13, 2008
If I have some data in a cell (let's say D1) such as "m-3,s-2,xl-4", what formula can I use in say cell D2 so that if I find the characters "s-" in Cell D1, then it will return the value "2".
Similarly, in say in Cell D3, I would then want to use the same formula but modify it so that if the characters "xl-" are contained within Cell D1, the formula will return "4"
View 5 Replies
View Related
Dec 29, 2008
Just "upgraded" my Excel to the 2007 version. In the old Excel, I could superscript part of a cell by highlighting the part I want, then going to "Format" and "Superscript."
In Excel 2007, it doesn't work. Yes, I can highlight the part of the cell I want to superscript, I can right-click and select "format" and "Superscript", and it even then shows as superscripted in the cell. That is, until I hit enter or move to a new cell. Then the superscript is no longer there. The cell is in "general" number format.
By the way, it did work in another cell: mg/l3 (3 superscripted) works. 742 (2 superscripted) doesn't work.
View 11 Replies
View Related
Feb 25, 2013
I have a cell that has this
ALG-g30
And I have another cell that looks like this
ADL G28 Clear Lamp Chimney 8-1/2 inches
I want the cell to look like this
ADL G30 Clear Lamp Chimney 8-1/2 inches
Basically I want to take the g30 and convert the "G" to uppercase and add it with the "30" to the other cell..
I need to do that with 40 rows..
How would I do that?
I copied the rows here down here --- [URL] .......
View 1 Replies
View Related
Jun 11, 2014
I would like to be able for a user to enter something in a cell (E14) and then press Find and it open a internal web search.
[Code]......
In this code %1234% would be in E14. How do I make the hyperlink change based on what is in cell E14?
The %2A has to stay in both beginning and end of the text in E14.
View 2 Replies
View Related
Jul 1, 2009
Column B on the spredsheet gets the Part Description vaules, we copy and paste from Customers excel and unfortunatly some descriptions contain 3asteriks in a row (***) and I need to import this into Access later on and Access will not except asteriks. Find and replace doesnt seem to work like i hoped , it replaces everything in cell not just part of it . If someone has a Formula that will work that would be ok too, it does not have ot be VBA
EXAMPLE Part Descriptions:
RADIAL TIE DOWN LUG (4/500's) *** Formed
FINES V-PLOW/ SCRAPER MOUNT ANGLE; Rev. A ***Formed
I only need the asteriks deleted
View 2 Replies
View Related
Dec 3, 2008
I have a few cells which look like this: ...
View 6 Replies
View Related
Sep 29, 2011
I have to perform a v-lookup to return a value but the problem is the cell I am looking up begins with but does not exactly match the the data in the table.
For example I want to look up sheet 1 cell A1 which is "Compass" in the table in sheet 2 column A and then return the associated value in column B. It is referenced as "Compass Group" in the table so I do not get a value returned if I use the exact matching function of the vlookup (i.e. using "false") but if I use the approx it one (i.e. "true") then it returns "Compagnie" which is the name listed before "Compass Group".
Basically I want to perform a vlookup function using a cell that begins with but not exactly matches a sting of letters in a table.
View 1 Replies
View Related
Feb 10, 2013
I have the following formula in my workbook;
=SUMPRODUCT((A2:A8702"")/COUNTIF(A2:A8702,A2:A8702&""))
The data in the workbook is imported automatically and the range 'A8702' is different every time the data is imported, although is always in column A.
Can I use the value of a cell to determine the range?
So I have used this to get the ast used row number;
=MAX(ROW(A:A)*(A:A""))
View 6 Replies
View Related