New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Find a string and then copy all the cells below that string

Macros, VBA, Excel Automation, etc.

Find a string and then copy all the cells below that string

Postby shrehman » Mon Dec 26, 2011 3:37 pm

I have one data file which contains a string "Total Subscribers" and I want to serach that string and then copy all the data below that string. For example the string is in cell B10 then I wan to copy the cells from B11 to B100 and paste it to cell M1. If the same string is in eg. C10 then it must copy the range C11 to C100 and this search is required upto Cell F10.

Please note I am not very good in VBA so write the code for me and if there is any way to do this without vba macro then also let me know please.

Thanks
  • 0

shrehman
Rookie
 
Posts: 1
Joined: Dec 26, 2011
Reputation: 0

Re: Find a string and then copy all the cells below that str

Postby Don » Mon Dec 26, 2011 10:37 pm

Hi and welcome to the forum!

Try this out:

Code: Select all
Sub copy()
Column = ActiveSheet.Range("A1:F10").Find("Total Subscribers").Column
Range(Cells(11, Column), Cells(100, Column)).copy
End Sub


hope this helps!
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 219 guests