+ Reply to Thread
Results 1 to 4 of 4

Put the result of the calculation between 2 columns in a new works

  1. #1
    Metin
    Guest

    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. #2
    Frank Kabel
    Guest

    Re: Put the result of the calculation between 2 columns in a new works

    Hi
    why do you want to use VBA and not a simple formula?

    --
    Regards
    Frank Kabel
    Frankfurt, Germany
    "Metin" <[email protected]> schrieb im Newsbeitrag
    news:[email protected]...
    > 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. #3
    Metin
    Guest

    Re: Put the result of the calculation between 2 columns in a new w

    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" <[email protected]> schrieb im Newsbeitrag
    > news:[email protected]...
    > > 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. #4
    Bob Phillips
    Guest

    Re: Put the result of the calculation between 2 columns in a new w

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> schrieb im Newsbeitrag
    > > news:[email protected]...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1