Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Metin
 
Posts: n/a
Default 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   Report Post  
Frank Kabel
 
Posts: n/a
Default

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   Report Post  
Metin
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Columns in Excel will not allow user to click in them Kim Excel Discussion (Misc queries) 1 December 28th 04 06:37 PM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM
Pivot Table Creating New Columns that Subtract Two Existing Columns den4673 Excel Discussion (Misc queries) 3 December 17th 04 01:31 PM
interchange columns with rows Herman Excel Discussion (Misc queries) 2 December 8th 04 05:40 PM
How can I find the common names in two columns of names? hako Excel Discussion (Misc queries) 2 December 8th 04 01:59 AM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"