+ Reply to Thread
Results 1 to 6 of 6

Count and write the number for every fifth row

  1. #1
    Registered User
    Join Date
    04-22-2014
    Location
    Halmstad, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    14

    Post Count and write the number for every fifth row

    Hallo!

    I need to have the counter to count every row consecutively, but to write the consecutive number in the first cell in every fifth row.
    F.e. A$1$ should have the number 1 but A$6$ should have the number 2 and so on.
    IŽd be really grateful for some help.


  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,871

    Re: Count and write the number for every fifth row

    Try this

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Count and write the number for every fifth row

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    04-22-2014
    Location
    Halmstad, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count and write the number for every fifth row

    Thanks very much, Mick!

    Your suggestion really worked out fine.

    Regards Anders

  5. #5
    Registered User
    Join Date
    04-22-2014
    Location
    Halmstad, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count and write the number for every fifth row

    Hallo, Alan!

    It seems to be my lucky day.
    Your option explicit turned out to work as well as Mick`s solution.
    At first I didnŽt succeed. Executing the macro returned a compilation error, but I notice having aligned
    y = InputBox("How many numbers to fill?") x=1 in the same row
    Separating x=1 solved the problem.

    Thanks very much!

    Have a nice day!
    Anders

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,871

    Re: Count and write the number for every fifth row

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks for the feedback.

+ 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. Replies: 8
    Last Post: 12-04-2013, 04:14 AM
  2. [SOLVED] Condition and function to write number value greater than a specific number
    By excelinexcel7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2012, 06:09 PM
  3. Replies: 13
    Last Post: 01-24-2012, 09:38 AM
  4. [SOLVED] How to write a count-if-not function?
    By Jsatter in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2006, 12:15 PM
  5. how i write a number on a column A and see that number on letters.
    By Mauricio in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2006, 05:35 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