+ Reply to Thread
Results 1 to 5 of 5

Copy Formula Down

  1. #1
    gregork
    Guest

    Copy Formula Down

    I have the following user form code to add data to a worksheet:

    Dim LastRow As Object

    Set LastRow = Worksheets("Raw
    Material").Range("b5000").End(xlUp)

    LastRow.Offset(1, 0).Value = TextBox5.Text
    LastRow.Offset(1, 2).Value = TextBox1.Text
    LastRow.Offset(1, 5).Value = ComboBox2.Text

    On the worksheet I have formulas in cells referring to the cells where I add
    data. These formulas will have to be filled all the way down the worksheet
    in anticipation of new entries. Instead of filling all these formulas down
    the sheet, is it possible to add code to what I use when I add data that
    will fill formulas down?

    GK




  2. #2
    Tom Ogilvy
    Guest

    Re: Copy Formula Down

    LastRow.Offset(1,3).Resize(1,2).Filldown


    assuming the last filled row has the formulas

    --
    Regards,
    Tom Ogilvy

    "gregork" <[email protected]> wrote in message
    news:[email protected]...
    > I have the following user form code to add data to a worksheet:
    >
    > Dim LastRow As Object
    >
    > Set LastRow = Worksheets("Raw
    > Material").Range("b5000").End(xlUp)
    >
    > LastRow.Offset(1, 0).Value = TextBox5.Text
    > LastRow.Offset(1, 2).Value = TextBox1.Text
    > LastRow.Offset(1, 5).Value = ComboBox2.Text
    >
    > On the worksheet I have formulas in cells referring to the cells where I

    add
    > data. These formulas will have to be filled all the way down the worksheet
    > in anticipation of new entries. Instead of filling all these formulas down
    > the sheet, is it possible to add code to what I use when I add data that
    > will fill formulas down?
    >
    > GK
    >
    >
    >




  3. #3
    gregork
    Guest

    Re: Copy Formula Down

    Great, thanks Tom, that will tidy my sheet up.......I really didn't like
    having formulas filled all the way down my columns.

    cheers
    GK

    "Tom Ogilvy" <[email protected]> wrote in message
    news:%[email protected]...
    > LastRow.Offset(1,3).Resize(1,2).Filldown
    >
    >
    > assuming the last filled row has the formulas
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "gregork" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have the following user form code to add data to a worksheet:
    > >
    > > Dim LastRow As Object
    > >
    > > Set LastRow = Worksheets("Raw
    > > Material").Range("b5000").End(xlUp)
    > >
    > > LastRow.Offset(1, 0).Value = TextBox5.Text
    > > LastRow.Offset(1, 2).Value = TextBox1.Text
    > > LastRow.Offset(1, 5).Value = ComboBox2.Text
    > >
    > > On the worksheet I have formulas in cells referring to the cells where I

    > add
    > > data. These formulas will have to be filled all the way down the

    worksheet
    > > in anticipation of new entries. Instead of filling all these formulas

    down
    > > the sheet, is it possible to add code to what I use when I add data that
    > > will fill formulas down?
    > >
    > > GK
    > >
    > >
    > >

    >
    >




  4. #4
    gregork
    Guest

    Re: Copy Formula Down

    Tom I'm hoping you're following this thread as I was wondering if it is
    possible to fill down the cell format as well as formula with code?

    regards
    GK


    "Tom Ogilvy" <[email protected]> wrote in message
    news:%[email protected]...
    > LastRow.Offset(1,3).Resize(1,2).Filldown
    >
    >
    > assuming the last filled row has the formulas
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "gregork" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have the following user form code to add data to a worksheet:
    > >
    > > Dim LastRow As Object
    > >
    > > Set LastRow = Worksheets("Raw
    > > Material").Range("b5000").End(xlUp)
    > >
    > > LastRow.Offset(1, 0).Value = TextBox5.Text
    > > LastRow.Offset(1, 2).Value = TextBox1.Text
    > > LastRow.Offset(1, 5).Value = ComboBox2.Text
    > >
    > > On the worksheet I have formulas in cells referring to the cells where I

    > add
    > > data. These formulas will have to be filled all the way down the

    worksheet
    > > in anticipation of new entries. Instead of filling all these formulas

    down
    > > the sheet, is it possible to add code to what I use when I add data that
    > > will fill formulas down?
    > >
    > > GK
    > >
    > >
    > >

    >
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: Copy Formula Down

    the code did fill down the format for me.

    --
    Regards,
    Tom Ogilvy

    "gregork" <[email protected]> wrote in message
    news:[email protected]...
    > Tom I'm hoping you're following this thread as I was wondering if it is
    > possible to fill down the cell format as well as formula with code?
    >
    > regards
    > GK
    >
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:%[email protected]...
    > > LastRow.Offset(1,3).Resize(1,2).Filldown
    > >
    > >
    > > assuming the last filled row has the formulas
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "gregork" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have the following user form code to add data to a worksheet:
    > > >
    > > > Dim LastRow As Object
    > > >
    > > > Set LastRow = Worksheets("Raw
    > > > Material").Range("b5000").End(xlUp)
    > > >
    > > > LastRow.Offset(1, 0).Value = TextBox5.Text
    > > > LastRow.Offset(1, 2).Value = TextBox1.Text
    > > > LastRow.Offset(1, 5).Value = ComboBox2.Text
    > > >
    > > > On the worksheet I have formulas in cells referring to the cells where

    I
    > > add
    > > > data. These formulas will have to be filled all the way down the

    > worksheet
    > > > in anticipation of new entries. Instead of filling all these formulas

    > down
    > > > the sheet, is it possible to add code to what I use when I add data

    that
    > > > will fill formulas down?
    > > >
    > > > GK
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




+ 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