Converting Textboxes Link and or Formula to Values in a Copied Sheet using Excel VBA

0 votes

I'm copying a sheet to another workbook using this VBA code:

Sub Macro1()
    Dim num As Integer
    Dim tbox As TextFrame2
    
    Sheets("2316 Printing Template (v2018)").Select
    Range("AS9").Select
    
    For i = 1 To 2
        Range("AS9").Value = i
        Sheets("2316 Printing Template (v2018)").Copy After:=Workbooks("Book1.xlsx").Sheets(i)
        With ActiveSheet.UsedRange
            .Value = .Value
        End With
        
        Worksheets("2316 Printing Template (v2018)").Name = Left(Range("AS12").Value, 31)
        Windows("2316 PrinterTemplate (2022).xlsm").Activate
    Next i
    
End Sub

As the value of Cell AS9 changes, the template's cells and textboxes update. I then duplicate the template to a different workbook and rename the newly created sheet. The textboxes are still connected to the original workbook and sheet, which is my current issue. How can I change them to be tied to values?

Here is a screenshot of the 2 files. The First one is the template: enter image description here

And this is the copied sheet: enter image description here

Jan 31, 2023 in Others by Kithuzzz
• 38,000 points
588 views

1 answer to this question.

0 votes

Copy the values using Range and Value2

With ActiveSheet.UsedRange
    Sheets("2316 Printing Template (v2018)").Range(.Address).Cells.Value2 = .Value2
End With
answered Jan 31, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
0 answers

Converting feet & inches (e.g., "5 ft 1 in") to decimal feet using VBA or Excel

I have a database with a few ...READ MORE

Nov 2, 2022 in Others by Kithuzzz
• 38,000 points
586 views
0 votes
0 answers

Excel VBA: Open Hyperlinks in a loop and copy paste download link in a sheet

I want to click on a number ...READ MORE

Dec 25, 2022 in Others by Kithuzzz
• 38,000 points
1,379 views
0 votes
1 answer

Excel VBA- How to loop through specific sheets in a workbook and format the same ranges in each sheet

Range(...) instructs VBA to always use the ...READ MORE

answered Mar 21, 2023 in Others by Kithuzzz
• 38,000 points
1,759 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,212 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,662 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
908 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,053 views
0 votes
1 answer

Is there a way to test a formula result in excel and type it only once, all within one cell and not using a user defined function?

Use the Let function: =LET(Value,A1+B2+C4+G3+B4,IF(Value>10,"No",Value)) I hope this helps ...READ MORE

answered Jan 9, 2023 in Others by narikkadan
• 63,600 points
665 views
0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,600 points
1,346 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP