Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Copy data from data sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 24 Mar 2008 22:37 GMT
Hi everyone.  I have a large data sheet, with the first 6 columns of
data I need.  Column 1 of the data sheet is an invoice number.  I then
have a calculation sheet.  In cell A2 of the calculation sheet is an
invoice number.  Can I have vba scan column A of the data sheet for
the invoice number in A2 and return columns 1 thru 6 into the
calculation sheet?  Thanks!!!
Barb Reinhardt - 24 Mar 2008 22:54 GMT
You can, but why wouldn't use use VLOOKUP instead?
Signature

HTH,
Barb Reinhardt

> Hi everyone.  I have a large data sheet, with the first 6 columns of
> data I need.  Column 1 of the data sheet is an invoice number.  I then
> have a calculation sheet.  In cell A2 of the calculation sheet is an
> invoice number.  Can I have vba scan column A of the data sheet for
> the invoice number in A2 and return columns 1 thru 6 into the
> calculation sheet?  Thanks!!!
Steve - 25 Mar 2008 03:44 GMT
Because I have multiple instances of the same invoice number.  I need
to copy in every instance of the given invoice number.  Thanks!

On Mar 24, 3:54 pm, Barb Reinhardt
<BarbReinha...@discussions.microsoft.com> wrote:
> You can, but why wouldn't use use VLOOKUP instead?
> --
[quoted text clipped - 9 lines]
>
> - Show quoted text -
GTVT06 - 26 Mar 2008 21:02 GMT
> Hi everyone.  I have a large data sheet, with the first 6 columns of
> data I need.  Column 1 of the data sheet is an invoice number.  I then
> have a calculation sheet.  In cell A2 of the calculation sheet is an
> invoice number.  Can I have vba scan column A of the data sheet for
> the invoice number in A2 and return columns 1 thru 6 into the
> calculation sheet?  Thanks!!!

This will find and select your data, but I'm not sure where you want
it pasted.

Sub FindRange()
Dim cell As Range
'Assuming Invoice numbers are located in
'L1:L50 as an example
   For Each cell In Worksheets("Data").Range("L1:L50")
       If cell.Value = Worksheets("Calc").Range("A2").Value Then
       Worksheets("Data").Activate
       Range(cell.Address & ":" & cell.Offset(0, 5).Address).Select
           End If
       Next cell
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.