Someone from this site...

eskelies

Board Regular
Joined
May 27, 2010
Messages
95
helped me with the following macro, but I was unable to remember his/her screenname. I'm trying to fix this macro to enlarge the range, but return the same data. Would someone be able to assist me?


Code:
Dim rngClients As Range
Dim mycell As Range
Dim startrow As Integer
Dim outputrow As Integer
startrow = 2        'Assumes data starts row 2
outputrow = 15      'output will start in row 15

'create Client range from start row + 5 extra rows
Set rngClients = Range(Cells(startrow, 5), Cells(startrow + 5, 10))
'Loop through all client cells and pick up the one's with amounts
For Each mycell In rngClients
    
    If mycell <> "" Then
        myfund = Cells(1, mycell.Column)  'Get the column header to identify client
        myTD = Cells(mycell.Row, 1)       'for all clients in same row
        mydeal = Cells(mycell.Row, 2)       'for all clients in same row
        myyield = Cells(mycell.Row, 3)       'for all clients in same row
        mySD = Cells(mycell.Row, 14)     'for all clients in same row
        myMD = Cells(mycell.Row, 15)     'for all clients in same row
        
        
        myamount = Cells(mycell.Row, mycell.Column) 'Get amount for Client
        
        'output data starting row
        'output data starting row
        Cells(outputrow, 1) = myfund
        Cells(outputrow, 2) = myamount
        Cells(outputrow, 3) = mydeal
        Cells(outputrow, 4) = myTD
        Cells(outputrow, 5) = mySD
        Cells(outputrow, 6) = myMD
        Cells(outputrow, 7) = myyield
        
        outputrow = outputrow + 1
    End If
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

zakasnak

Active Member
Joined
Sep 21, 2005
Messages
307
you can see all of your posts if you click on your name, then select the statistics tab

Code:
Find all posts by YOU
Find all threads started by YOU
 

eskelies

Board Regular
Joined
May 27, 2010
Messages
95
I wasn't thinking. This was an easy fix. I didn't change the correct area.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,474
Messages
5,601,880
Members
414,479
Latest member
Beau the dog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top