Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Put the result of the calculation between 2 columns in a new works
Hi all,
I have a worksheet with 18 columns. Each column has a lot of data, and each time I have various number of data. The number of data can be between 200 and 5000 in one column. The number of data in each column is always equal.The data starts at row 2, because row 1 is always the title. I want to subtract the data from column J with data from column F, and the results I want to put in a new sheet, called "calculate data" in Column F. Could somebody tell me how to do this with VB. Thanx, -Metin- |
#2
|
|||
|
|||
Hi
why do you want to use VBA and not a simple formula? -- Regards Frank Kabel Frankfurt, Germany "Metin" schrieb im Newsbeitrag ... Hi all, I have a worksheet with 18 columns. Each column has a lot of data, and each time I have various number of data. The number of data can be between 200 and 5000 in one column. The number of data in each column is always equal.The data starts at row 2, because row 1 is always the title. I want to subtract the data from column J with data from column F, and the results I want to put in a new sheet, called "calculate data" in Column F. Could somebody tell me how to do this with VB. Thanx, -Metin- |
#3
|
|||
|
|||
I have it already in simple formula. I need it for further calculations and
when I have new data I don't want to use the template of a previous file. Very often the users forgot to delete the remaining data of the previous file. In VBA I have already did the insert of new sheet and the insert of the titles. If you know how to do it in VBA, pls tell me. "Frank Kabel" wrote: Hi why do you want to use VBA and not a simple formula? -- Regards Frank Kabel Frankfurt, Germany "Metin" schrieb im Newsbeitrag ... Hi all, I have a worksheet with 18 columns. Each column has a lot of data, and each time I have various number of data. The number of data can be between 200 and 5000 in one column. The number of data in each column is always equal.The data starts at row 2, because row 1 is always the title. I want to subtract the data from column J with data from column F, and the results I want to put in a new sheet, called "calculate data" in Column F. Could somebody tell me how to do this with VB. Thanx, -Metin- |
#4
|
|||
|
|||
Here is a VBA solution
Sub test() Dim i As Long Dim cLastRow As Long Dim oWS As Worksheet With Worksheets("Sheet1") cLastRow = .Cells(.Rows.Count, "J").End(xlUp).Row Set oWS = Worksheets.Add oWS.Name = "calculate data" oWS.Cells(1, "J").Value = .Cells(1, "J").Value For i = 2 To cLastRow oWS.Cells(i, "J").Value = .Cells(i, "J").Value - _ .Cells(i, "F").Value Next i End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Metin" wrote in message ... I have it already in simple formula. I need it for further calculations and when I have new data I don't want to use the template of a previous file. Very often the users forgot to delete the remaining data of the previous file. In VBA I have already did the insert of new sheet and the insert of the titles. If you know how to do it in VBA, pls tell me. "Frank Kabel" wrote: Hi why do you want to use VBA and not a simple formula? -- Regards Frank Kabel Frankfurt, Germany "Metin" schrieb im Newsbeitrag ... Hi all, I have a worksheet with 18 columns. Each column has a lot of data, and each time I have various number of data. The number of data can be between 200 and 5000 in one column. The number of data in each column is always equal.The data starts at row 2, because row 1 is always the title. I want to subtract the data from column J with data from column F, and the results I want to put in a new sheet, called "calculate data" in Column F. Could somebody tell me how to do this with VB. Thanx, -Metin- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Columns in Excel will not allow user to click in them | Excel Discussion (Misc queries) | |||
Counting the Contents of Two Columns | Excel Discussion (Misc queries) | |||
Pivot Table Creating New Columns that Subtract Two Existing Columns | Excel Discussion (Misc queries) | |||
interchange columns with rows | Excel Discussion (Misc queries) | |||
How can I find the common names in two columns of names? | Excel Discussion (Misc queries) |