Results 1 to 2 of 2

Runtime error trying to move col from one location to another.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Runtime error trying to move col from one location to another.

    Hi, i am enclosing a test file.

    I am trying to move column AD in-between cols 7 and 8.

    I have this code.......but it does not seem to work. I thought i had used something like this before and it worked but for some reason i cant figure it out. Any thoughts?

    Sub test()
    
    Dim fl_name As String
    
    fl_name = ThisWorkbook.Name
    
    Set inputfileworksheet = Workbooks(fl_name).Worksheets("Quality Compliance")
    
    last_row_in_study_col = 169
    Study_Col_number = 30
    
    inputfileworksheet.Columns(Study_Col_number).Resize(last_row_in_study_col, 1).Cut
    inputfileworksheet.Columns(8).Resize(last_row_in_study_col, 1).Insert Shift:=xlToRight
    
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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