+ Reply to Thread
Results 1 to 21 of 21

VBA to Split Workbook: No Longer Converting Formula Results to Values

Hybrid View

AliGW VBA to Split Workbook: No... 03-01-2019, 05:27 AM
Trebor76 Re: VBA to Split Workbook: No... 03-01-2019, 05:56 AM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 06:01 AM
Trebor76 Re: VBA to Split Workbook: No... 03-01-2019, 06:34 AM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 06:48 AM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 06:43 AM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 08:58 AM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 09:15 AM
bakerman2 Re: VBA to Split Workbook: No... 03-01-2019, 01:10 PM
AliGW Re: VBA to Split Workbook: No... 03-01-2019, 01:25 PM
bakerman2 Re: VBA to Split Workbook: No... 03-02-2019, 02:37 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 04:33 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 04:54 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 04:24 AM
bakerman2 Re: VBA to Split Workbook: No... 03-02-2019, 04:37 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 04:57 AM
bakerman2 Re: VBA to Split Workbook: No... 03-02-2019, 05:02 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 05:15 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 05:19 AM
AliGW Re: VBA to Split Workbook: No... 03-02-2019, 05:34 AM
bakerman2 Re: VBA to Split Workbook: No... 03-02-2019, 05:46 AM
  1. #1
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,617

    Re: VBA to Split Workbook: No Longer Converting Formula Results to Values

    Here goes nothing.
    Private Sub CmdPrint_Click()
        Dim DateString As String
        Dim FolderName As String
        Dim x As Long
        Dim FileFormatNum As Long
    
        Application.ScreenUpdating = False
        DateString = Format(Now, "dd mmmm yyyy")
        FolderName = "C:\Users\Alison\OneDrive - Royal Hospital School\Documents\Timetable WIP\2019-20\Staffing Grids for HoDs" & " " & DateString
        For x = 0 To LstPrint.ListCount - 1
            If LstPrint.Selected(x) = True Then
                Application.CopyObjectsWithCells = False
                With Sheets(LstPrint.List(x))
                    If .ProtectContents = True Then
                        .Unprotect
                        .Copy , Sheets(Sheets.Count)
                        .Protect
                    Else
                        .Copy Sheets(Sheets.Count)
                    End If
                End With
                Application.CopyObjectsWithCells = True
                With Sheets(Sheets.Count)
                    .Range("H1").Value = LstPrint.List(x)
                    .Range("B2:U4").Value = .Range("B2:U4")
                    .Range("E94:U104").Value = .Range("E94:U104").Value
                    .Copy
                End With
                With ActiveWorkbook
                    .Sheets(1).Protect
                    .Sheets(1).Name = LstPrint.List(x)
                    If .HasVBProject Then
                        FileFormatNum = 52
                    Else
                        FileFormatNum = 51
                    End If
                    .SaveAs FolderName & "\" & LstPrint.List(x), FileFormatNum
                    .Close False
                End With
            End If
        Next
        Application.DisplayAlerts = False
        Sheets(Sheets.Count).Delete
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
        Unload Me
    End Sub
    Last edited by bakerman2; 03-02-2019 at 02:40 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,505

    Re: VBA to Split Workbook: No Longer Converting Formula Results to Values

    Nope.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    1
    HoD Timetable Request - March 2019
    Return to AGW by Friday 29 March 2019
    Department: Art
    2
    Year Groups &
    Teaching Groups
    3
    4
    5
    No. of periods
    per fortnight
    Totals
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    6
    KS3
    40
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    Sheet: Art
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,505

    Re: VBA to Split Workbook: No Longer Converting Formula Results to Values

    As asked before, if you copy a sheet within the workbook itself are the values in the copy displayed correctly then ?
    No, they can't do because the formula in E3 can't work because the tab name has changed, so H1 is not showing the correct value. That's what I was saying in post #10.

    What needs to happen is for JUST cell H1 to change from a formula to a value on the first copy, then for the named ranges to change to values on the second copy. Does this make sense?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split macro no longer working
    By PandoraGirl in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-07-2019, 05:33 PM
  2. [SOLVED] split formula of data not giving expected results need assistance
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-15-2018, 12:57 PM
  3. Replies: 1
    Last Post: 04-13-2017, 08:59 PM
  4. Replies: 9
    Last Post: 09-22-2015, 02:43 AM
  5. Formula to search all cells in a workbook for characters longer than 6
    By hoochoo in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-21-2015, 07:19 AM
  6. [SOLVED] Converting a formula into just the results
    By matt1020 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-14-2013, 03:06 PM
  7. [SOLVED] Formula needed to split the results of a DSUM from another worksheet
    By RandomNumber in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-31-2012, 10:50 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