+ Reply to Thread
Results 1 to 4 of 4

Counting rows and fill data down

  1. #1
    Registered User
    Join Date
    01-13-2022
    Location
    Motta di Livenza, Italy
    MS-Off Ver
    Excel 2016
    Posts
    25

    Counting rows and fill data down

    Hello there! I have a question about the file attached.

    Basically, I have to automate a task with VBA, but given that my level is not that advanced I'm struggling to find the best way to do it. Here is what I have to do:

    1) Starting from Column E, from cell E2, I usually paste a list of ID codes from another software, whose number is indefinite, it is different every time
    2) The same goes for Column D, whose content is coming from another software
    3) Then focus on Column A, B and C:

     Column A - I need to use the RIGHT function to extract the last 3 digits from the ID code in Column E
     Column B - I need to use the LEFT function to extract the first 10 digits from the ID code in Column E
     Column C - I would need to extract either CR or DR from the Price Point Key in Column E. The problem is that the structure of the Price Point Key can change for every currency, so I don't know specifically after how many characters I will find CR or DR

    Now, for steps 1) and 2) I don't need VBA, while for step 3) I need it. Of course I know how to write the formulas with RIGHT & LEFT in VBA, but I need:

    - a way to fill the formulas (RIGHT and LEFT) in Column A and B down to an indefinite number of rows, depending on whether there is content in the cells in Column E
    - a way to extract either CR or DR from the Price Point Key in Column D, and fill it down to an indefinite number of rows



    I was thinking about using an arbitrary number of rows, like a cap, or to use a loop, but maybe there are other alternatives. Does anyone have any idea?

    Thanks a lot in advance for your time!
    Attached Files Attached Files
    Last edited by antotom98; 09-27-2022 at 02:59 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Counting rows and fill data down

    small macro on orange button - no need for on sheet formula will work as you extend data rows

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Counting rows and fill data down

    Other option
    Please Login or Register  to view this content.
    If you are happy with your formulas in columns A & b
    This code for Credit type only
    Please Login or Register  to view this content.
    Last edited by mohadin; 09-27-2022 at 06:50 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Counting rows and fill data down

    Non looping Option...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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] Counting of rows that has data
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2020, 07:56 AM
  2. Transpose rows to column and insert new rows to fill in data
    By Apple Ling in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2019, 04:02 AM
  3. [SOLVED] Counting whether cells are used to fill data from a fixed cell
    By Grandsire54 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-10-2016, 07:13 PM
  4. [SOLVED] Fill Handle Problems (fill data from 2 rows)
    By JoelPak in forum Excel General
    Replies: 5
    Last Post: 03-10-2016, 12:34 PM
  5. Fill every 4 rows with same data
    By fred123 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-25-2015, 03:31 AM
  6. Replies: 3
    Last Post: 08-18-2009, 09:46 PM
  7. Counting data in rows.
    By paulrm906 in forum Excel General
    Replies: 6
    Last Post: 01-15-2006, 10: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