Results 1 to 3 of 3

VBA search string copies and pasts formulas from worksheet tabs and recalculates?

Threaded View

  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    8

    VBA search string copies and pasts formulas from worksheet tabs and recalculates?

    I just need it to search other work sheets and only populate the answers. Currently it searchs and repopulates the formulas causing it to recalculate.

    Sub Find_First()
        Dim FindString As String
        Dim Rng As Range
        Dim MaterialValue As String
        Dim SheetNumber As Integer
        Dim Counter As Integer
        Rows("5:5").Select
        Range(Selection, Selection.End(xlDown)).Select
        Application.CutCopyMode = False
        Selection.Delete Shift:=xlUp
           Status = InputBox("Please Enter the Material Number You want to Search")
           If Status = "" Then
           MsgBox "Operation Cancelled"
           Else:
           MaterialValue = Status
           
    SheetNumber = 1
    Range("A5").Select
    line1:
    Counter = 0
    SheetNumber = SheetNumber + 1
    If SheetNumber > ThisWorkbook.Sheets.Count Then
    Worksheets(1).Activate
    MsgBox "A & B items are heavly used"
    Else
        FindString = MaterialValue
        Worksheets(SheetNumber).Activate
        Counter = Application.WorksheetFunction.CountIf(Range("d:d"), MaterialValue)
        If Trim(FindString) <> "" Then
        With Sheets(SheetNumber).Range("d:d")
                Set Rng = .Find(What:=FindString, _
                                After:=.Cells(.Cells.Count), _
                                LookIn:=xlValues, _
                                LookAt:=xlWhole, _
                                SearchOrder:=xlByRows, _
                                SearchDirection:=xlNext, _
                                MatchCase:=False)
                If Not Rng Is Nothing Then
                    Application.GoTo Rng, True
                End If
        End With
        For x = 1 To Counter
            ActiveCell.Offset(0, -3).Select
            Range(ActiveCell, ActiveCell.Offset(0, 18)).Copy
            Worksheets("RANKSTER").Activate
            ActiveSheet.Paste
            ActiveCell.Offset(1, 0).Select
            Worksheets(SheetNumber).Activate
            Cells.FindNext(After:=ActiveCell).Activate
        Next
       GoTo line1
        End If
     End If
     End If
       End Sub
    image 2.jpgimage1.jpg
    Attached Images Attached Images
    Last edited by tysonbly; 01-12-2015 at 02:36 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to extract selected records from a table and pasts them in another worksheet
    By adelkam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2014, 12:10 AM
  2. Excel recalculates when there are no formulas
    By fack7960 in forum Excel General
    Replies: 4
    Last Post: 03-25-2014, 01:40 PM
  3. [SOLVED] I need help writing an Macro that looks up values and copies and pasts them to an sheet
    By trent.bourne in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2013, 10:01 AM
  4. Replies: 1
    Last Post: 09-20-2012, 03:22 PM
  5. VBA recalculates formulas even when stepping through unrelated code?
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-10-2009, 11:11 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1