+ Reply to Thread
Results 1 to 2 of 2

Thread: Copy formulas with text to new sheet

  1. #1
    Registered User
    Join Date
    09-01-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Exclamation Copy formulas with text to new sheet

    Hey again!

    Really loving this place.

    I have a macro that extracts text from multiple worksheets and places it in a column along with the cell reference and worksheet name. I'd like to do the same thing but instead of text I'd like it to pull formulas with text only. Some of the formulas have more than one word associated with them.

    EX:

    =IF($B34="","Enter Part Number",IF($D34="","Enter OEM",IF($F34="","Enter Quantity",IF($G34="","Enter Published List Unit Price",IF(VLOOKUP($D34,LAN_Range,2,FALSE)="","Enter NE Discount",($G34-(VLOOKUP($D34,LAN_Range,2,FALSE)*$G34))*$F34)))))
    Here's the current formula:

    Public Sub texttonewsheet()
    Dim n As Long, i As Long
    Dim Rng As range
    With Application
    .Calculation = xlCalculationManual
    .ScreenUpdating = False
    End With
    n = 1
    For i = 2 To Sheets.Count
    For Each Rng In Sheets(i).range("A1:CI200")
    If Rng.Value <> "" Then
    If Not Application.IsNumber(Rng) Then
    Sheets(1).range("A" & n).Value = Rng.Value
    Sheets(1).range("B" & n).Value = Rng.Address
    Sheets(1).range("C" & n).Value = Sheets(i).Name
    n = n + 1
    End If
    End If
    Next Rng
    Next i
    With Application
    .Calculation = xlCalculationAutomatic
    .ScreenUpdating = True
    End With
    End Sub

    Any help would be appreciated...

    Thanks!

    Sar
    Last edited by sarahtonin; 09-03-2010 at 10:02 AM. Reason: Added code for formulas

  2. #2
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Copy formulas with text to new sheet

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0