Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 2 of 2

Thread: Find data in one sheet copy them and paste them to another

  1. #1
    Join Date
    2nd June 2011
    Posts
    3

    Find data in one sheet copy them and paste them to another

    HELLO,

    i have some data on one sheet1, more specifically company names and below them a specific number.

    I want to use an inputbox that a company name will be entered, then find all of the same company name in sheet1 and each time the company name is found COPY the cell below the company name and paste it to another sheet, at a specific location.

    Thanks, very much in advance

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    2nd June 2011
    Posts
    3

    Re: Find data in one sheet copy them and paste them to another

    help.xlsxi wrote this code but ity does no stop looping

    VB:
    Sub select_data() 
        Dim mysting As String 
        Dim foundcell As range 
        Dim range1 As range 
        Dim cell1 As range 
        Dim counter As Integer 
        counter = 3 
        mystring = InputBox("enter what to be found") 
        Sheets("data").Activate 
        Set range1 = ActiveSheet.range("a1:h31") 
         
        With range1 
            Set foundcell = range1.Find(What:=mystring, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) 
            If Not foundcell Is Nothing Then 
                firstadress = foundcell.Address 
                Do 
                    Set cell1 = foundcell 
                    cell1.Copy 
                    Sheets("select data").Activate 
                    Cells(counter, 2).Select 
                    ActiveSheet.Paste 
                    counter = counter + 1 
                    Set foundcell = .FindNext(foundcell) 
                Loop While Not foundcell Is Nothing And foundcell.Address <> firstaddress 
            End If 
        End With 
    End Sub 
    
    

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Find-copy and paste in new sheet
    By Sportman in forum EXCEL HELP
    Replies: 4
    Last Post: January 3rd, 2011, 15:31
  2. Find Heading, Copy & Paste Related To Another Sheet
    By Noel2008 in forum EXCEL HELP
    Replies: 1
    Last Post: June 6th, 2008, 19:43
  3. Find, Copy, Paste To Another Sheet
    By sanmisds in forum EXCEL HELP
    Replies: 4
    Last Post: August 30th, 2007, 02:06
  4. Find, Copy And Paste Into Another Sheet
    By Tiffany in forum EXCEL HELP
    Replies: 3
    Last Post: December 8th, 2006, 10:33
  5. Find, copy, paste to diffrent sheet
    By gjustynski in forum EXCEL HELP
    Replies: 5
    Last Post: April 25th, 2006, 03:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno