+ Reply to Thread
Results 1 to 4 of 4

Change MAcro so it adds 5 to different formula

  1. #1
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Change MAcro so it adds 5 to different formula

    Hello i am currently using the following code to copy and insert rows on a spreadsheet

    Please Login or Register  to view this content.
    I was wondering how i could change this so that instead on adding the formula above and adding 5 it adds the following and add 5

    Please Login or Register  to view this content.
    Thanks

    I look forward to hear from people!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Change MAcro so it adds 5 to different formula

    I don't see where you are adding 5 anywhere--what do you mean by that?

    Your first formula calculates a row number, and your second formula has $B$10 and $C$10 as absolute references. Do you mean to use the same calculation as used in your first version? Like this:

    Please Login or Register  to view this content.

    Also, I recommend you use Option Explicit to guarantee that all variables are declared, and declare l. (Also, l is not a great variable name because it can be confused with 1 when reading.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Change MAcro so it adds 5 to different formula

    Hello sorry, I did not explain this very well. It copies 11 rows and pastes them after the last row with data on the worksheet. It then adds 5 to the formula that i have in column A. So ='Student Details & Data. i would like it to add 5 to a different formula the one i showed above as i have changed some elements and now the first name and surname of the student are now in separate cells.

    So the bit it is adding 5 to is the Formula that links to the student details & data tab.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Change MAcro so it adds 5 to different formula

    Sorry, I'm not getting this at all. It might help if you attach your file so I can see what the sheets look like.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Problem in macro that adds the coloumn.
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-15-2013, 02:59 AM
  2. Replies: 19
    Last Post: 03-04-2013, 01:16 PM
  3. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  4. Replies: 5
    Last Post: 09-15-2011, 05:23 AM
  5. Replies: 2
    Last Post: 01-06-2010, 05:51 AM
  6. [SOLVED] Macro that adds records
    By john in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2006, 11:00 AM
  7. [SOLVED] macro that adds left and right footers
    By Keith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2005, 10:05 AM
  8. Replies: 3
    Last Post: 02-02-2005, 02:50 PM

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