+ Reply to Thread
Results 1 to 4 of 4

Fill n rows with same value

  1. #1
    bugmenot
    Guest

    Fill n rows with same value

    Hello Excel Experts!

    I have a problem that sounds easy enough, but I haven't been able to solve it yet. I have a spread sheet that looks sort of like this:

    Please Login or Register  to view this content.
    I'm trying to get excel to read the number next to Apples and fill 12 rows with the word Apples, then 43 rows with Oranges and so on.

    Any ideas?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello bugmenot,

    This macro will insert the required number of rows and fill the column using the cell values as in your example. Copy this into a Standard VBA Module. The starting cell is "B2". You can change the Starting column and row by changing the values marked in red.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    bugmenot
    Guest
    I'm getting a run time error 13 "type mismatch' if the data does not start in B2, and nothing happens when it does. Is there a difference between German and English versions of Excel?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello bugmenot,

    The macro reads the data as in your example. I simply choose to use column A and B for the macro. Row 2 was choosen as the start row in case you a had a header in row 1. You can change these values to what ever you are using on the worksheet. See my previous post for the variables to be changed.
    Please Login or Register  to view this content.
    I can't answer your question about possible diffrences between English and German versions of Excel. However, Visual Basic for Applications should be relative free of differences, expect for code that is language dependent. Can you post your workbook for review?

    Sincerely,
    Leith Ross

+ 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