Is it possible to format cells so that inputed tel. numbers are all have the same format and not just appear the same, regardless of how they were typed in?
i need it so the column can be sorded by phone #.
I have a limited amount of VBA knowledge. My limited knowledge is based on solving my problems by looking at the answers already on this site and trying to adapt it to my needs. Here goes:
I import a list of address and telephone numbers (100+) into excel. example - Cell A1 contains "10 downing street, whitehall, london, SW1A 2AA 01234 567890", sometimes there is another space after the number, sometimes there is no telephone number. I want to remove the telephone number at the end if it is there. Have searched the forums have have come up with the follow solution:
1. import list to column A 2. copy and paste Trim to column B 3. copy values in column B and paste to column A 4. delete column B 5. remove the end numbers 6. copy and paste Trim to column B 7. copy values in column B and paste to column A 8. delete column B 9. remove the end numbers
It looks like this in code:
Sub testa()
'select (=TRIM(A1)) formula and paste to sheet Sheets("Formulas").Select Columns("B:B").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet4").Select Columns("B:B").Select ActiveSheet.Paste
[Code]...
'copy values of column B to Column A and delete column B
'copy values of column B to Column A and delete column B
Columns("B:B").Select Selection.Copy Columns("A:A").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Columns("B:B").Select Application.CutCopyMode = False Selection.ClearContents Range("A1").Select End Sub
I know this is a long winded way around (still chuffed I worked it out by myself though!). If I merge all the macros into one marco it continually loops and deletes everything in the cells and I have to press escape to stop it.
My questions are:
1. Why, when I merge all the macros doesnt it work the same as individual macros? (I would like to know for future reference). 2. Its there a better way to remove the telephone numbers?
I have a large data set (excel file), of "Names", "Phone Numbers", and i need to sort this based on the States that correspond with the Phone numbers. The states currently do not exist in the spreadsheet, so my current problem is trying to insert those states into the spreadsheet.
There are over 100 area codes in the data set, so i'll likely have to write a large "If" statement in VB to run through them all, but that shouldnt be a problem.
NAME, PHONE, STATE Bleh, 555-555-5555, =ChkState(B2)
I've been playing around with the VB Stuff in Excel and this is what i've come up with for trying to insert the State field
Function ChkState(pVal As String) As Long
Dim AreaCode As String Dim StateAbrv As String
AreaCode = Left(pVal, 3)
If AreaCode = "201" Then StateAbrv = "Test201" ElseIf AreaCode = "203" Then StateAbrv = "Test203" ElseIf AreaCode = "555" Then StateAbrv = "Test555" Else StateAbrv = "0" End If MsgBox StateAbrv End Function
I'm fairly new to this VB stuff, my main problem stems from trying to insert the "StateAbrv" back into the Cell for the spreadsheet.
i have 2 columns the first is the transaction number and second column is the description
i want to make that all even transaction number will highlight the whole row... how do i make that with conditional formatting? or are there other alternatives?
Tracking winning lottery numbers using conditional formating on a worksheet.CF only allows 3 formats I need 10 is there a way around this.In cell B2 I choose Conditional Formatting from the Format menu.I select Formula is from the drop down menu,and enter the formula =COUNTIF($N$2:$S$2,B2)>0 Then I hit OK.I then click on the Painter button on the toolbar and apply this formatting to the rest of the lotto numbers.I can do this 2 other times but i need it to work 10 more times,if there is no way around this, is this formula possible in VBA and how do I enter it.
This has definitely been done before, but I am not sure if it has been done through Excel/VBA.
I have a 9 or 10 digit telephone number, preceded by a zero and what I want to do is get Excel to figure out the combinations of text characters that will allow me to have a text phone number.
For Example: 0-800-43573375 is the same as 0-800-HELPDESK
I run an online store where all the product details are handled by a .CSV file and naturally all the information has to be exact or it won't work at all especially UPC codes and product codes. However whenever I open the .CSV file to edit anything it auto formats several bit of information including several UPCs and product codes that begin with one or more 0's. This among many other problem I have had are all caused by excel's auto formating "tool" and I find it of absolutely no use. Is there any way at all to disable this "tool" so it will stop messing with my data every time I need to make a product change? (I have tried using the '0 trick but when I save the file and open it again later all the '0s are gone again)
I have an excel document that has one columb (I) of cells that changes color depending on a specific date (columb h) . The cells that have conditional formating to change the row color based on where it is ( =MOD(ROW(),2)=1), stays blank and the proper color until columb A is filled in. The others show up red. How would I code/format the lines that aren't included in the conditional formating to always show white when no value is entered in columb a.
can i format the cells that i have made grey for this photo to automatic put : between numbers i put in like the time.example if i would put in a cell 1200 than it would be like 12:00 is that possible i have been through all the time formats in the format cells options but i always get this result ###.
the other ? is can i take the S away when i have formated cells to show kilograms so it would be like 550 kg instead of 550 kgs ?
I need to replace a "." with a "," to stay in the right format, by using VBA.
if i make a macro to do it, it will work for almost all cells but for a few it doens't work! Then, if i select the cell with mouse and replace "." with a "," it works normaly.
My question is why it doesn't work for a few fields if all the data have the same format?
I have h26 and h27 both can generate a number if h26 is a number i need f26 to formate in dollors if h27 is a number i need f26 to be general formate
in the cells h26 and h27 they will already be in that format how can i get them to go to f26 like that
******** ******************** ************************************************************************>Microsoft Excel - PROTOTYPE2207.xls___Running: xl2002 XP : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutF26= EFGH26s1*$1.0027***1Weekly Stats* [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
I have a column with addresses and I need to separate it into columns, the main problem is that sometimes the listing has house number sometimes it does not some time it has town but, some time it does not and the post code is not separated from the county - if no house number then that column is to remain empty.
how to use the conditional format tool, but now the company i designed the spreadsheet for, wants me to implement a change. I'm attacking a copy of the spreadsheet so you can see the problem more easily. Now what I've been asked todo is the following.
1. When the stock quantity (Column H) goes below the re-order level (Column K), they want the entire row to change font colour from blue to red. Now I know how i can change the colour of one cell, like ive done in the example, but I'm not sure how to change the entire row colour. If this can be done with conditioning formating then great, but if not then i'm stuck, and relying on your generosity in helping me out.
I have a large X-Y-axis table with about 200 entries in it. There are 6 different entries possible. I now want to give each possible entry in this table a color for making it easier to read.
I could write a formula in conditional formating, so that it works for 3 colors. The problem is now that i can make this only for 3 different colors in conditional formating of excel. Is there a possibility for making this for 6 colors?
I have two columns from which criteria must be satisifed. column A denotes gender (m or f) and column B denotes a number of points. I want to sum those males who achieve >4 in one cell and those females who achieve >4 in another cell.
I want to set up formula in conditional formating so that when:
$AF6 = "CA" the color is red or if $AF6 = ("GA","ME","PR") then the color is blue
what I came up with is Condition 1 = ($AF6 ="ca") [which will turn the cell red] Condition 2 ="OR($AF6={""GA"",""ME"",""PR""}, "")" [which doesn't do anything]
Asks almost exactly the question I have, but I can't make heads or tails out of the answers, I'm guessing becasue I have Excel 2003 and not 2007 as mentioned in the replies.
In column "A" I have a number; column "B" the formula =A1 copied on down and in column "C" either a 1 or 2 or a 3.
If the number in column "C" is a 1 then the font in the same cell in Column "B" should be black, 2 Blue and 3 Red.
I'm thinking this should be very simple, but so far it's not turning out that way. )-:
I would like to format a cell so when i enter a six digit number, such as 123456 it would appear starting with a QW then the year, month and day in the format of yymmdd and them the six digit number so it would appear as QWYYMMDD123456, or since today is 01/09/09 is would be QW090109123456
I would like the yymmdd field to be taken from the main location where the date is entered and the QW can be in another field so when I go to another blank field and enter a six digit number, for example 123456 it will be changed to QW090108123456. I hope you can follow this and that I explained it in a matter that is understood.
Can this code be simplified? I currently have this code repeated 15 times, I need to color the ranges yellow and then unlock them. So for now I am repeating the code below for range ("C19:N26") and then 14 other ranges.
And if you have suggestions on cleaning up the code below please let me know, I would like to know the proper/most efficient way to write code.
Sub FormatingBudgetFiles()
'Colors each Forecast cell yellow that the end user can change
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets ws.Activate With ActiveWindow Range("c14:k14").Select End With
if its possible to run conditional formating on graphs, I can do this fine on the actual data
i.e. Have a bar chart with a number of bars all the same colour and just wanted to have the bars change to red if they drop below a certain percentage.