Macro For Equaling The No Of Digits & Prefixing The Numbers
Jun 27, 2009
I have some numbers around 200 numbers which are not same digits i.e. if 1st number is 7 digits, 2nd number is of 10 digits.
Like this even if i have a number of 1 or 2 digits then all number should have equal digits i.e. in 200 numbers if one numbers is of 13 digits then all the numbers should be 13 digits.
To do this first i am doing this to the right align & comparison all numbers & taking the highest digit number & pre-fixing the other numbers with zeros so that all number are equal in number of digits. This is taking huge time.
I want to make a macro or any easy method so that all should have equal no of digits.
I want that if 200 numbers are pasted in the column E i.e. from E2 to E201 then all should be converted to equal digits number by prefixing zeros & should appear in column G from G2 to G201.
And after converting them it should be prefixed with D/ OR D/ABC:
This will be present in B2 cell i.e. this cell will be blank always. And once I have any thing in that cell that should be prefixed to the converted numbers in the column G & they should appear in Column I.
And again the numbers in column G should be prefixed with the content in B2 & should appear in column K in the Ascending order sorted.
Suppose if , I have 500 numbers then they should be converted automatically to equal digits & appear in Column G & prefixed with the contented in cell B2 should appear in Column I & sorted series in ascending order with prefixed with cell B2 in the column K.
And if I have 15 numbers only then it should do the same job easily. Here the numbers of numbers are not defined.
All this should be get done on click of the command button.
View 9 Replies
ADVERTISEMENT
Apr 30, 2014
I have the following working great, but would like to see it refine a little, as the data vlookup is 6 digits, but i only needs the last 4 digits is enough for me to work, my question is how do i go about adding that to the following function i have implemented and working fine.
=IF(ISERROR(VLOOKUP(B4,' cmfs01home$peter[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE)),"",VLOOKUP(B4,' cmfs01home$peter[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE)
View 12 Replies
View Related
Jun 1, 2012
vb code that will break out each 6 digit media used in their own rows such as in the illustration below.
Sample data before macro
Master Backup
GTI - Hostname
[Code]....
View 2 Replies
View Related
Jan 29, 2014
I have a excel file, I need to remove the first two digits if they are certain numbers, such as 12. For example, if the number is 12987654, then I need remove 12, and it will be "987654" , but if it is not 12 in the first two digits, then keep it no change, for example if it is 345678, then keep it.
I barely work with Excel formulas, now I need connect the excel file with my Database table. I need to make the file matches the DB.
View 12 Replies
View Related
Nov 17, 2009
Example numbers:
21130 & 21065
I want to check each number if EITHER of the two conditions is true:
1. if the third digit from the right (the hundreth place) is greater than zero;
or
2. if the second digit from the right (the tens place) is >=6.
If either is true I want to add a particular number to the original number.
My example numbers meet questions 1 & 2, respectively.
View 11 Replies
View Related
Feb 2, 2010
this may be simple but I need to convent say
A1 = 09
B1 = 23
into
C1 = 0
D1 = 9
E1 = 2
F1 = 3
..etc
View 11 Replies
View Related
Oct 13, 2007
I have a unique 6 digit number in a column. I have 2500 rows. I need to cut the first three numbers only leaving the last 3 numbers in the column for each row.
Example:
112345
234325
I would need 112, and 234 deleted. Checked the forum and cannot get quite what I want.
View 9 Replies
View Related
May 6, 2008
I have a column with numbers in about 500 rows. The entries are 5 numbers long and others 8. So I thought i could use one of the following: A macro code to tell a cell to delete the first 3 numbers if the entry is 8 numbers long?
OR
A macro code to tell a cell to reduce itself to 5 digits long starting from the right? Attached is a small example
View 3 Replies
View Related
Oct 15, 2013
I need to list 4 digit numbers in each section followed by commas, but whatever I do it goes to 3digits (e.g. I need "1234,5678,9123" and as soon as I hit Enter it goes to "123,456,789,123"). It wont work to format as text because I have a whole bunch of 12 digit numbers to break up into 4.
View 9 Replies
View Related
Jul 16, 2008
I need a way to display all 8 digit numbers that have the digits 1-8 in them. (ie. 12345678 but NOT 12345679 OR 12345677) Also If I could somehow divide by 13 then check for whole numbers
View 14 Replies
View Related
May 27, 2008
I would like to extract numbers based on the first 2 digits (22....) of a column along with its next column (on the right) and put them on another sheet.
View 9 Replies
View Related
Nov 7, 2008
I am inserting data into my spreadsheet using VBA code to read a file and insert the data into the relevant cells. My problem arises when I have a string such as 80830410205724044. The actual code that inserts the data is as shown (temp is dimmed as string)....
View 9 Replies
View Related
Mar 24, 2009
I have a UPC list. Some are more than 12 digits, and some with less than 12 digits. I need to make sure there are 12 digits in each UPC. I know how to count using LEN, strip leading zeros of those UPCs that are >12 digits using RIGHT.
What I need now is any number with less than 12 digits, such as 000123, add a 4 to the beginning (4000123) and fill in '0's in between the 4 and the short UPC number to make 12 digits, 400000000123. They vary from 1 to 13 digits.
View 4 Replies
View Related
Jun 16, 2008
I have a macro that copies long decimals (11 places) from an Excel file to a CSV file. However, the long decimals often get truncated from 11 places down to 3 or 4. I've tried a number of different coding methods to combat this, the most recent and most successful of which is shown below
Application.Workbooks.Open Filename:="C:...2008_alldata.csv"
Cells.Select
Selection.ClearContents
ActiveWindow.ActivateNext
Application.Goto Reference:="AllDataTable"
Selection.Copy
ActiveWindow.ActivateNext
Application.Goto Reference:="R1C1"
Selection.PasteSpecial Paste:=xlPasteValues
Range("R2:BI5000").Select
Selection.NumberFormat = "#,##0.00000000000"
ActiveWorkbook.Save
ActiveWindow.Close savechanges:=False
However, sometimes this method also fails. Is there a better way anyone knows of to ensure that the entire decimal is copied?
View 3 Replies
View Related
Jul 16, 2009
I am trying to filter my excel sheet based on certain digits in a column of part numbers. The part number has 10 characters. I would like to filter it so that all part numbers where the 4th character is the number 5 or 7 is listed and where the 5th character is a zero. (i.e. R4X5831310 is a part number where 5 is the 4th character; I would like the filter to show this part number)
View 2 Replies
View Related
Jun 22, 2014
I have a column that has section numbers like 001.002.006.003.010.011.002.
I would like to divide that single column into seven columns with only the single or double digit in it, ie
1 in a cell
2 in a cell
6 in a cell
3 in a cell
10 in a cell
11 in a cell
2 in a cell
Have been using MID and FIND togther, but when I get to the double digits like 10 an 11 I run into problems.
View 3 Replies
View Related
Jun 17, 2009
I need a formula to drag down the attached that will place zeros infront of any numbers that don't have 9 digits. so if a part number consists of 6 digits then i need 3 zeros in front of it, if a part number consists of 9 digits then i dont need any zeros proceeding it.
View 2 Replies
View Related
Oct 31, 2008
i need to format my numbers in the following format
10,00,000.00
the first three digits will be separated and then subsequently 2 digits
View 2 Replies
View Related
Dec 14, 2009
I have a simple formula which subtracts one cell from another. I then have an if and statement which checks if that cell is equal to zero. If so, continue processing.
The problem is that the formula always reads the cell as not equal to zero although the result of the formula contained in the cell does result in zero.
View 5 Replies
View Related
Jan 2, 2012
I'm using excel to keep track of information at work and have formulas set to figure out totals weekly. The problem comes about when I sum up each column, why doesn't the column totals use the same formula as the top.
Example would be
2 X 5 = 10
3 X 8 = 24
4 X 5 = 20
6 X 5 = 30
15 23 84 sum total of all columns
15 X 23 = 345 why do I come up with 345 instead of 84 when using the same formula as above
View 4 Replies
View Related
Feb 26, 2008
I have a countif formula that calculates the number of entries between 2 dates. However i now need to also count how many of these match a 3rd value.
So i will need to work out how many "are greater than or equal to B2" "less than or equal to C2" and "equalling D2"
what i have already
=(-COUNT('Current Work'!AE8:AE2000)+COUNTIF('Current Work'!AE8:AE2000,">="&B2)+COUNTIF('Current Work'!AE8:AE2000,"<="&C2))
View 4 Replies
View Related
Sep 21, 2009
I have a macro that is used several times a day. Four digits are entered in cell E5, then I press Enter, then click on an icon that has a macro assigned to it.
Is there a way to trigger the macro after simply entering the four digits? Or can the macro be triggered after entering the four digits then pressing Enter?
View 4 Replies
View Related
Aug 9, 2007
I am using Excel 2003. I am trying to importing a 20 character from a barcode scanner to cell K2 in an Excel spreadsheet. When the part is scanned, the program handling the scanner data shows the data as being 12345678901234567890. I am running a macro that retrieves that data and places it in cell K2. The number that appears in cell K2 is 12345678901234500000. The macro module code reads:
Sub GetSWData()
Dim WedgeData As Variant
Dim MyPort As String
Dim Chan As Long
Dim StringVar As String
Dim DataIn As Double
MyPort = "COM1"
Application.DisplayAlerts = False
Chan = DDEInitiate("WinWedge", MyPort)
WedgeData = DDERequest(Chan, "Field(1)")
DataIn = WedgeData(1)
Range("K2").Value = WedgeData(1)
DDETerminate Chan
End Sub
I am guessing that one of the Dim statements has the wrong word after As but nothing I have tried gets me past this point.
View 7 Replies
View Related
Apr 20, 2013
Conditional Formating Text equaling to Number formats:
Example:
C20 is '436.59 (its pasted as text often is must remain as text) and D20 is 436.9535
I want D20 to have only 2 decimals and turn green if it equals C20. And turn red if it doesnt equal C20.
View 1 Replies
View Related
Jan 15, 2014
I have two columns
Column L and Column W
When I input something into Column W, I want it to turn green if it is equal to the corresponding value in Column L
So say we're on Row 50
And I put $280 in Cell W50
I want it to turn green if W50=L50
And red if W50 does not equal L 50
Infinitely in the same column
View 5 Replies
View Related
Sep 30, 2006
I guess this would work in a similar manner as Solver, but where Solver tweaks cell values to equal a given total, I've got a set of cells and I need to find the combination that equals an amount in another cell. Is there a way to do this?
View 7 Replies
View Related
Sep 25, 2009
I am editing a wine database which contains a vast amount of data, one column has the wine name and sometimes the vintage year in the begining or at the end of the cell. Sometimes the year is made of 2 digits (03, 05, ..) or 4 digits (1978, 2004, 2005, ...).
Is there a way to remove this vintage year form the string?
to make matters worse, there is often a single quote/apostrophe in front of the vintage year, which is driving me mad as 98% of the time it is one of these hidden ones that cannot be deleted using the find/replace function.
examples are like below:
De Wetshof Finesse/Lesca Cahrdonnay 07
De Wetshof Sauvignon Blanc 07
Lord Neethling Cabernet Franc 2002
Lord Neethling Pinotage 01
Bouchard Finlayson Tete de Cuvee Pinot Noir 07
Jacobsdal Pinotage 1994
Zondernaam Sauvignon Blanc 2007
Tokara Red
1976 St Emilion
03 Tokara rose
Plasir de Merle Cabernet Sauvignon 05
DuToitskloof Pinotage/Merlot/Ruby Cabernet
1999 Tradition Juracon 375ml
I have been searching the Internet for the past 2 days without luck on how to delete the end of string vintage year.
I have had some luck with the left side, as in:
=IF(ISERROR(VALUE(LEFT(B2,SEARCH(" ",B2)-1))),B2,MID(B2,SEARCH(" ",B2)+1,LEN(B2)))
As I am not an expert with Excel, I have no idea on how to use VBA (every time I have tried even basic things, I failed) nor even sure how the above funtion works (found it on another site).
I thought I could acheive my goal in two steps, first removing the left side vintage and use this partial result with the RIGHT equivalent funtion, but it simply is not working!
View 14 Replies
View Related
Sep 25, 2009
I am editing a wine database which contains a vast amount of data, one column has the wine name and sometimes the vintage year in the begining or at the end of the cell.
Sometimes the year is made of 2 digits (03, 05, ..) or 4 digits (1978, 2004, 2005, ...).
Is there a way to remove this vintage year form the string?
to make matters worse, there is often a single quote/apostrophe in front of the vintage year, which is driving me mad as 98% of the time it is one of these hidden ones that cannot be deleted using the find/replace function.
examples are like below:
De Wetshof Finesse/Lesca Cahrdonnay 07
De Wetshof Sauvignon Blanc 07
Lord Neethling Cabernet Franc 2002
Lord Neethling Pinotage 01
Bouchard Finlayson Tete de Cuvee Pinot Noir 07
Jacobsdal Pinotage 1994
Zondernaam Sauvignon Blanc 2007
2003 Tokara Red
1976 St Emilion
03 Tokara rose
Plasir de Merle Cabernet Sauvignon 05
I have been searching the Internet for the past 2 days without luck on how to delete the end of string vintage year.
I have had some luck with the left side, as in:
=IF(ISERROR(VALUE(LEFT(B2,SEARCH(" ",B2)-1))),B2,MID(B2,SEARCH(" ",B2)+1,LEN(B2)))
As I am not an expert with Excel, I have no idea on how to use VBA (every time I have tried even basic things, I failed) nor even sure how the above funtion works (found it on another site).
I thought I could acheive my goal in two steps, first removing the left side vintage and use this partial result with the RIGHT equivalent funtion, but it simply is not working!
Does anyone have an idea on how to help with this?
Ideally I would love to cut the vintage year, whether 2 or 4 digit, whether on right or left of cell and paste it in another cell, so to avoid manually doing it.
However, this is surely too complicated to do, so iwould settle with just deleting the vintage year and manually typing the vintage in another cell.
View 9 Replies
View Related
Jan 26, 2009
In column A I have 10,000 road names with many duplicates. In column B I have the duplicate roads removed with only one left (about 1400). In column C I have a map code for that road, married to column B. Question; how do I get the map code to post to all the equaled roads in column A?
View 4 Replies
View Related
Aug 4, 2009
I am trying to create a formula that shows a percentage of cells within a range that contain a particular number. This percentage is based on another cell, which is the total number of all audits. Each audit has rating columns, with a numeric value indicating it's rating. I need to count those cells within the range that equal the numeric value assigned to the rating, and then divide that total by the total number of audits to obtain a percentage of calls with each particular rating in each category.
Here is an example of what I'm trying to accomplish:
A1 = 2 (Total audits)
B1 = 07/31/2009 (Date of first audit)
C1 = 3 (Rating of first category)
D1 = 1 (Rating of second category)
E1 = 2 (Rating of third category)
F1 = 08/03/2009 (Date of second audit)
G1 = 0 (Rating of first category)
H1 = 2 (Rating of second category)
I1 = 2 (Rating of third category)
The percentage of audits within the first category that have a rating of 3 would be 50%.
The percentage of audits within the second category that have a rating of 3 would be 0%.
The percentage of audits within the third category that have a rating of 2 would be 100%.
View 9 Replies
View Related