anyone ???
Last edited by belkin; 07-07-2011 at 03:13 AM.
Hello
I wish to create a macro to search a sheet called "data" for a number in column a only. Once it has found that number, copy and paste special and transpose in a worksheet called "user page" in cell "b2" say, Then i want to be able to modify the info just pasted and then use a second macro to take the modified info and replace back in the "data" where it came from in the same row ideally. i am currently doing it using a valadation list for my number and a macro to filter the row i want copying and pasting in a new weeksheet then copying again, but the marco is slow and i am looking to have the vba run faster but i do not quite have the skiils to manage it. Any help would be appreciated.
example work book attached 2003!
Belkin
Last edited by belkin; 07-07-2011 at 03:44 AM.
In attached file, when you type something in range A2 it will retrieve data from second sheet. Then modify data and click on update command.
I used these macros:
Regards,Private Sub Worksheet_Change(ByVal Target As Range) Dim mySh As Worksheet, found As Range If Target.Address(0, 0) = "A2" Then 'find data Set mySh = ThisWorkbook.Sheets(2) Set found = mySh.Range("a:a").Find(Target.Value, LookAt:=xlWhole) If Not found Is Nothing Then 'copy 100 columns, A-CV found.Resize(1, 100).Copy Target.Offset(, 1) End If End If End Sub Sub Update() Dim mySh1 As Worksheet, mySh2 As Worksheet, found As Range Set mySh1 = ThisWorkbook.ActiveSheet Set mySh2 = ThisWorkbook.Sheets(2) Set found = mySh2.Range("a:a").Find(mySh1.Range("a2").Value, LookAt:=xlWhole) If Not found Is Nothing Then mySh1.Range("b2").Resize(1, 100).Copy found End If End Sub
Antonio
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks