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
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,673
Messages
5,838,706
Members
430,565
Latest member
cheredia

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