jmarkc
03-23-2009, 09:50 AM
I'm hoping someone can help. I've been searching this site and other quite a bit, but cannot find the code I need
or can't modify code enough to suit my need.
I have a couple of simple worksheets that will be part of a bigger project. To begin with, 1 worksheet ("Output")
will contain some company information and by pressing a command button, the user can pull up the source of that
information.
So, sheet 2 ("Data List") contains all the source information. In that worksheet, column A contains the company
name, column b contains the source information, which can be 2 rows or 15 rows of information (in the form of hyperlinks).
I have some code that looks in cell b4 of the Output sheet for the company name, then finds it in the Data List sheet.
That works fine. What I can't seem to do is to copy the accompanying data in column b of the Data List sheet and
paste it to B10 in the Output sheet.
ub SupportDataMacro1()
Application.ScreenUpdating = False
Dim Name As String
Dim rFound As Range
' Find Supplier Name from 1 sheet in another sheet
Name = Sheets("Output").Range("b4")
On Error Resume Next
With Sheets("Data List")
Set rFound = .Columns(1).Find(What:=Name, After:=.Cells(1, 1), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
On Error GoTo 0
If Not rFound Is Nothing Then Application.Goto rFound, True
End With
' Once Supplier Name is found, copy web data
Selection.Offset(0, 1).Activate
'NEED SOME HELP HERE!
Application.ScreenUpdating = True
End Sub
I think it's a simple solution, but I can't seem to wrap my hands around it. Any help is very much appreciated.
I have attached the workbook.
or can't modify code enough to suit my need.
I have a couple of simple worksheets that will be part of a bigger project. To begin with, 1 worksheet ("Output")
will contain some company information and by pressing a command button, the user can pull up the source of that
information.
So, sheet 2 ("Data List") contains all the source information. In that worksheet, column A contains the company
name, column b contains the source information, which can be 2 rows or 15 rows of information (in the form of hyperlinks).
I have some code that looks in cell b4 of the Output sheet for the company name, then finds it in the Data List sheet.
That works fine. What I can't seem to do is to copy the accompanying data in column b of the Data List sheet and
paste it to B10 in the Output sheet.
ub SupportDataMacro1()
Application.ScreenUpdating = False
Dim Name As String
Dim rFound As Range
' Find Supplier Name from 1 sheet in another sheet
Name = Sheets("Output").Range("b4")
On Error Resume Next
With Sheets("Data List")
Set rFound = .Columns(1).Find(What:=Name, After:=.Cells(1, 1), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
On Error GoTo 0
If Not rFound Is Nothing Then Application.Goto rFound, True
End With
' Once Supplier Name is found, copy web data
Selection.Offset(0, 1).Activate
'NEED SOME HELP HERE!
Application.ScreenUpdating = True
End Sub
I think it's a simple solution, but I can't seem to wrap my hands around it. Any help is very much appreciated.
I have attached the workbook.