Convert The Data In Column B To Number?
Jul 30, 2014convert the data in column B to Number so that i can perform action in Column D. see attachment for the query.
View 3 Repliesconvert the data in column B to Number so that i can perform action in Column D. see attachment for the query.
View 3 RepliesA column:
18
42
55
11
65
72
80
48
..
I want to put/write to B column the some numbers (42,11,72,48..) in A column.
B column:
=A2
=A4
=A6
=A8
..
How can I achieve it?
in a macro i have this: col=cell.column 'suppose col=16384. then i need to place in a cell this formula =(XFD2708*100/XFD2597)-100 so i'm looking for "something" that can convert 16384 in XFD.
View 2 Replies View RelatedI need to convert a column letter to a column number for the following line of code in my VBA application:
VB:
strAverageBaseFormula = "=AVERAGE(D" & Trim(Str(lngFirstRowOfIncrement + 1)) & ":K" & Trim(Str(lngFirstRowOfIncrement + 1)) & ")"
I am inserting a formula into a cell using VBA, but the problem is that I don't know the letter value of column "K" (used in the middle of the line); instead, I know it as column number 11. Is there a simple way to convert the column number 11 to the column letter "K"?
Im trying to convert the data in certain columns to number. I need to select the rows in those columns based on the rows counted in another column with a different heading, this is because there can be breaks in the data half way down the columns.
The Code I have so Far is:
Code:
Sub ConvertTonumber()
'Convert Certain Columns to numbers
'Use the "x"column to Calculate how many rows are required to fill the columns.
Dim ColX As Range
[Code]....
Some bits of code I have learned use column numbers and some bits use column letters.
Can someone share a line or two that I could add to my macro that will convert the F representing column F into a 6, and vice versa, so that I can continue using my pre-existing bits?
I can obtain the columns numbers but I cannot get the letters. Is there anyway to convert from a number to a letter?
eg. somefunction(1) gives me column(A) as an answer?
I have a excelsheet that looks like this:
Column A | Column B | Column C
Los Angeles | Fire Dept | 3
Los Angeles | Health Services | 12
New York | Fire Dept | 8
New York | Health Services | 22
New York | Internal Services | 100
New York | Public Works | 7
Chicago | Health Services | 15
Chicago | Public Works | 56
Chicago | Social Services | 4
And I am trying to make it look like this:
Fire Dept
Health Services
Internal Services
Public Works
Social Services
Los Angeles
3
12
New York
8
22
100
7
Chicago
15
56
4
I wanted to know if there was a way to either make a variable hold a column letter or else automatically convert a column number to a letter. This would be for use in the Range property.
All I could find is some complicated technique requiring division by 26 that I will never remember let alone code quickly.
Or if you have a variable holding a column number, is the only way to use it with Cells?
I have M106 = 4
I need a simple formula to convert that into column Alphabet + 1
So 4 will be Column E (A,B,C,D and 4th will be D+1= E)
Is there an easy way (without writing my own conversion function) to get the column letter from a range object, as opposed to the column number?
View 5 Replies View Relatedi was stuck with some mass data which spans over many rows and columns. i am relatively new to excel and wanted to know how i can get this data arranged in a way where i can access all the data from a printable view. i have attached a file explaining basically what i want.
View 5 Replies View RelatedHere's a sample of the document I have, the original has several thousand entries, so figured for the sample I'd limit it. The raw data is on sheet 1, and sheet 2 is what I want to have to more easily manipulate the data. I started doing it manually, but I'm sure there's a far better method that I just don't know about yet. sample.xlsx
For those that don't want to download the document:
My data is like this:
ID1 Field1
ID1 Field2
ID1 Field3
ID2 Field1
ID2 Field2
ID2 Field3
ID3 Field1
etc.
What I want is this:
ID1 ID2
Field1 Field1
Field2 Field2
Field3 Field3
etc.
I need to convert a column of data which will have repeated values into a column that turns that data into data with all unique values. Below is an example.
Column1Column2
AppleApple_1
OrangeOrange_1
PearPear_1
AppleApple_2
PearPear_2
PearPear_3
AppleApple_3
OrangeOrange_2
OrangeOrange_3
I had a solution until I wanted to turn this range into a list. The solution was.
=If(ISBLANK(A2),"",A2&"_"& COUNTIF($A$2:A2,A2))
When this data is in the list the <A2> in the range stops incrimenting from row to row and simply turns into the last row of the list. I have an example spread sheet upon request.
I student data in the following format
STUD ID, Surname, Forename, Subject
E.g
0001,Smith, Stan,Biology
0001,Smith,Stan,Chemistry
0001,Smith,Stan,Physics
Etc
I would like to display it so instead of there being multiple rows per student there is just 1 row with each subject in a new column
e.g
STUD ID,Surname,Forename, Subject 1, Subject 2, Subject 3
e.g
0001,Smith,Stan, Biology, Chemistry, Physics
Is there any way I can do this quickly for hundreds of students?
I have exported a text file from a universe database and need to import it into excel.
Below is an eg of one section. The text file contains approx 257 of these, all one below the other.
Between each set of dotted lines is one user profile (not data all shown in eg) .
Each one (user) is NOT the same amount of lines(rows) deep and only the dotted lines separate each user.
A simple import places all data into one very long column.
I need a way to place each user in there own column.
I have user names as column headings the labels of the values below as row headings. I cannot change this.
Manually entering the data took a very long time and i need to update this workbook regularly.
In the text file, " the variable......: value " (eg UserCode.....: XYZ) sets are all lined up so that using a text editor, with column mode, I can delete all the data headings/labels up to the space after the colon.
This leaves me with 7000 rows of values (eg XYZ) one column wide and various numbers of rows deep per user.
Is there a way to import the data and seperate each user via the dotted lines or other so that each users data is contained in consecutive columns. 1 user profile per column.
The standard import utility allows for column placement (delimted, fixed width). Can this be done on rows, sort of flip it 90 degrees and use the dotted lines as column markers. Just guessing now. Any and all assistance would be most appreciated.
Another issue (not as important but still helpful) is that the "procudures barred" section of user profile can also be one row(line) or serveral. Problem is each Name...:Value set must be on one row(line) for everything to match in the work book.
Using custom macros in my text editor i moved all the 'proc. barred' data to a single row. Alot of manual editting was involved and any ideas on this area would also be muchly appreciated.
One EG user profile (not shown, but all the colons line up) ....
I want some vbs code on my 'Copy All' button in Email Data sheet which will do my work. Its a bit lengthy but who knows the concept will find it easy.
I have one sheets -
Sheet attached - Worksheet .xlsm
Workshet.xlsm [Data in 'Mod' sheet i)should convert from text to column and paste in 'Row Data' sheet ii) then transfer form Row Data sheet to 'Email Data' sheet 'Mobile Data' sheet and 'Other Data' sheet when Copy All button is clicked in Email Data sheet.
There should be some logic which will fetch appropriate date from 'Mod' sheet to the respective sheet . We can have some kind of logic like
If 'Register' found then take the value of register and workstation and paste in Email Data sheet.
All data below should be fetched from Row Data sheet which is blank now and will get the data when we click the Copy All button ,
1st Register Count:
Below Register Count (*) i.e. 16 If workstation count present copy to E15 in Email Data sheet in Table B
Below Register Count (*) i.e. 9 If register count present copy to E16 in Email Data sheet Table B
2nd Register Count:
Below Register Count (*) i.e. 8942 If workstation count present copy to C15 in Email Data sheet in Table B
Below Register Count (*) i.e. 2883 If register count present copy to C16 in Email Data sheet in Table B
3rd Register Count:
Below Register Count (*) i.e. 0 If workstation count present copy to E18 in Email Data sheet in Table B
Below Register Count (*) i.e. 1 If register count present copy to E19 in Email Data sheet in Table B
4th Register Count:
Below Register Count (*) i.e. 98 If workstation count present copy to C18 in Email Data sheet in Table B
Below Register Count (*) i.e. 999 If register count present copy to C19 in Email Data sheet in Table B
Substr:
B32:B44 will be pasted in C29:C41 in Email Data sheet in Table C
i.e. 10 to 22 values should match in corresponding 10 to 22 values in Email Data sheet , if not not any value then 0
B50:B62 will be pasted in B29:B41 in Email Data sheet in Table C
i.e. 10 to 22 values should match in corresponding 10 to 22 values in Email Data sheet , if not not any value then 0
I have data (400 rows) that looks like this: (23 columns in total): (for this example I am using only 4 rows and 7 columns = 28 rows)
IN_0168 IN_0164 MH_0007 IN_0172 WCD3_03 WCD3_04 #N/A
IN_0176 IN_0172 WCD3_03 WCD3_04 #N/A #N/A #N/A
IN_0185 MH_0006 IN_0164 MH_0007 IN_0172 WCD3_03 WCD3_04
IN_0191 IN_0193 IN_0195 IN_0199 WAT10 #N/A #N/A
and I want it to look like this:
IN_0168
IN_0164
MH_0007
IN_0172
WCD3_03
WCD3_04
#N/A
IN_0176
IN_0172
WCD3_03
[code]....
This is what I was trying to do:
For m = 2 To 5
For n = 1 To 23
For b = 2 To 100
Sheets("Hierarchy").Select
Cells(m, n).Select
Selection.Copy
Sheets("HierN_H2V").Select
Cells(b, 1).Select
[code]....
I have A:1 - X365 filled with hourly energy prices for 2013. I need to convert these to a single column - A1:A8760. I have tried writing some code and some macros with no success.
If I were to do it manually 365 times, the macro would look like this:
Copy Row A1:X1
select sheet 2
Paste Special > Transpose (fills A1:A24)
repeat for rows 2-365
Tried using this from a previous post, but it takes A1:A24 then B1:B24 and so on and makes them a single column - so it doesn't work unfortunately.
Sub MakeColumn()
Dim rng As Range
Dim LastRowSrc As Long
Dim LastRowDst As Long
Set rng = Worksheets("Sheet1").Range("A1")
[Code] .....
I need to convert an Excel column sheet into rows for loading into a database, lots of columns, need to do repetitively over the enxt few months: For example...
Cust SKU Jan Feb Mar Apr May...
AAA 1234 10 19 14 ... ...
BBB 1234 21 88 42
BBB 5678 56 56 43
...becomes
Cust SKU Month QTY
AAA 1234 Jan 10
AAA 1234 Feb 19
AAA 1234 Mar 14
BBB 1234 Jan 21
BBB 1234 Feb 88
I have a problem that when I try to convert text to number and format the number without 2 decimal places as seen on the link I have given below, Instead of 1607.947, I get 1607947. I have Excel 2010 loaded. The details are in below picture.
[URL]
CountryHourDataTotalData
Austria - A10Sum of SeiA51CountryHourSum of SeiASum of SeiT
Sum of SeiT4.88Austria - A10514.88
1Sum of SeiA561562.83
[Code]....
left side pivot created in vb 6.0 & right side pivot table created manually in excel.
i want to generated pivot table using vb 6.0 same as right side pivot.
Set PRange = ws1.Range("R1:Y" & finalrow)
Set PTCache = wb.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=PRange)
Set PT = PTCache.CreatePivotTable(TableDestination:=ws2.Cells(1, 1),
[Code]....
Does clipboard method gettext retreive the text from clipboard only, not number? What if numbers are copied (Ctrl C) to clipboard?
View 9 Replies View Relatedi have this function that poulates data from a userform into a sheet.
For lLoop = 1 To MAWBNoVar
With Range("B" & Rows.Count).End(xlUp)
.Offset(1, 0) = Controls("txtMAWB" & lLoop)
.Offset(1, 1) = Left(Controls("cbDestination" & lLoop), 3)
.Offset(1, 2) = Controls("txtGW" & lLoop)
.Offset(1, 3) = Controls("txtCBM" & lLoop)
.Offset(1, 4) = "= ROUND(E" & Y & "*167,0)"
.Offset(1, 5) = "=IF(D" & Y & ">F" & Y & ",D" & Y & ",F" & Y & ")"
.Offset(1, 6) = "=IF(F" & Y & ">D" & Y & ",G" & Y & "-D" & Y & ",G" & Y & "-F" & Y & ")"
Y = Y + 1
End With
Next lLoop
My problem is that the data being entered into the sheet for the lines highlighted in red is going in as text, and not true numerics, so that the subsequent formulae are not working correctly.
how to get the number of rows with data in a particular column.
Date
12/2
11/3
10/2
11/4
here DATE is the column heading
and here number of rows with data is 4
HOW to get it from VBA statements
The yellow highlighted column F (each Reason) in the sheet2 to be placed as main header in the next column and so on as seen in the sheet 3
If they have two similar item number with 2 different reasons - delete the duplicate item number and place the number in each column according to its reason as seen on row 16 on the sheet3
If they have two number with similar reason - just sum up the number
sample excel 2.xlsx
a macro to convert this;
a
b
c
d
[Code]...
Into this;
x
a
9
x
b
[Code]...
So far I have the following, but this is not quite right!
[QUOTE][Sub ConvertRange()
Dim targetRowNumber As Long
targetRowNumber = Selection.Rows(Selection.Rows.Count).Row + 2
Dim col1 As Variant
[Code]...
/QUOTE]#
Sheet1
DEPARTMENTLOCATION POSITION TITLEPOSITION NUMBERCODEKXNJCEO34500A3100KXNJCEO34501A3200DXDLMGR42001A5600DXDLMGR42002A5700NXNLCHIEF23001A1200
Data Range: A1:E6
Sheet2
DEPARTMENTPOSITION NUMBERLOCATION POSITION TITLECODEKX34500ANJCEO3100KX34501ANJCEO9100DX42001ADLMGR5600DX42002ADLMGR5700NX23001ANLCHIEF1200
Data Range: A1:E6
What I need is a formula (Not a VBA), is to reconcile both sheet2 and sheet1 ensure that the codes appearing for each position number in sheet1 gets updated based on the codes for each position number appearing in sheet2. So, for instance, the code for pos #34501A should be changed from 3200 to 9100 in sheet1.
The only issue with sheet2, though, is that the column number for position number could be different each time new data gets copied into sheet2 (thought the header information stays the same). I know that it can be done via Vlookup if the place of the column doesn't change each time, but I just
How to locate the correct column and row in a range of cells to search and then extract information based on certain conditions.
In a worksheet, how do I convert a column of dates into a column of each date's numeric value?
View 7 Replies View RelatedHow can I compare the data of two columns, and if the same, to show me the number from a third column? I upload a quick sample
View 4 Replies View Related