+ Reply to Thread
Results 1 to 5 of 5

[VBA] Multiply each cell of a column 5 times

  1. #1
    Registered User
    Join Date
    10-22-2011
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question [VBA] Multiply each cell of a column 5 times

    Hi,

    This is for sure sth easy to code in VBA, but I'm relatively new to it and I feel stucked.

    I have a column with date, e.g. column A with the values John (cell A1), Mary (cell A2) & Tom (cell A3).

    I need to replicate that matrix in other column (let's say column B) multiplying each value 5 times. Following with the example, I would have John (cells B1:B5), Mary (cells B6:B10) & Tom (cells B11:B15).

    I've tryed with a For Each loop, but may I need to anidate a For-Next inside a For Each.

    Could you help me on this please?

    Thank you!
    Last edited by Eldexoly; 10-22-2011 at 12:27 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: [VBA] Multiply each cell of a column 5 times

    With a formula, in B1, then copied down:

    =INDEX(A:A, CEILING(ROW()/5,1))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: [VBA] Multiply each cell of a column 5 times

    And a VBA version:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: [VBA] Multiply each cell of a column 5 times

    Hi Eldexoly and welcome to the forum.

    Find the attached with the code that does what you want.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    10-22-2011
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    11

    Thumbs up Re: [VBA] Multiply each cell of a column 5 times

    Thank you Sirs!! That's what I'm looking for.

    I prefer a VBA solution because I need to repeat the process many thousand of times and formulas would increase a lot the weight of the file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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