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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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
Back
Top