Results 1 to 4 of 4

Macro to Freeze Values of Cells in Present Column, Move Right, Repeat

Threaded View

  1. #1
    Registered User
    Join Date
    05-03-2022
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    21

    Macro to Freeze Values of Cells in Present Column, Move Right, Repeat

    In the attached Test.xlsm, I have columns containing formulas. I would like to set up a macro that will freeze those formulas (i.e., convert to fixed values): freeze the next 10 columns, save, move to the 11th column, repeat. So far, my macro looks like this:

    Sub FreezeColumns()
    ' FreezeColumns Macro
        Columns("A:J").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveSheet.Paste
        Application.CutCopyMode = False
        Range("K1").Select
        ActiveWorkbook.Save
    End Sub
    Questions and problems:

    1. I don't know how to specify the next 10 columns relative to the present point. This code refers to columns A through J because I started in cell A1. But how can I get it to refer to the next 10 columns after I've moved to cell K1?
    2. After freezing the next 10 columns, I need to move to the 11th column, same row. At present, I have Range("K1").Select. Should I use something like ActiveSheet.Cells(11,0).Select ?
    3. Ideally, to stop when it reaches a column with no data on row 1, I think I should use Do While - Cells(i,1).Value = but I'm not sure how to represent a null value.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 03-29-2018, 10:20 PM
  2. [SOLVED] If cells match then freeze (copy paste values) in each column in the workbook.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2015, 06:12 AM
  3. Replies: 2
    Last Post: 09-03-2014, 03:37 AM
  4. How to bring comma separated values present in a column into cells in next row?
    By Palraj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2014, 08:17 AM
  5. Making a macro repeat for all values in column and leave results on WS2
    By jackuspi2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2013, 12:34 PM
  6. Replies: 0
    Last Post: 03-13-2013, 11:59 AM
  7. Macro - Copy/Paste certain cells and move down column and repeat
    By rohan87 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 02:02 AM

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.6.0 RC 1