Results 1 to 4 of 4

Run Module From Designated Key or Active X?

Threaded View

jayclinton Run Module From Designated... 03-13-2015, 05:38 AM
Kyle123 Re: Run Module From... 03-13-2015, 05:41 AM
jayclinton Re: Run Module From... 03-13-2015, 06:19 AM
jaslake Re: Run Module From... 03-13-2015, 09:53 AM
  1. #1
    Forum Contributor
    Join Date
    12-17-2008
    Location
    Vernon, CT
    Posts
    132

    Run Module From Designated Key or Active X?

    Hi everyone,

    I just started trying to teach myself how to use VBA/Macros ect. I have a workbook (attached) that I am trying to flip a range at will (vertically). I found a VBA script that enables me to do this, but I have to first press [Alt] + [F11] which opens up the module and then [F5] to run it. It then brings me to my sheet to select a range. I would like it to remain on the sheet and have a quicker access without losing my place.

    Column A will always be changing and I need to flip certain segments of column B for relabeling. This will show me what the previous location was and what to change it to.

    The script is as follows:
    Sub FlipColumns()
    'Updateby20131126
    Dim Rng As Range
    Dim WorkRng As Range
    Dim Arr As Variant
    Dim i As Integer, j As Integer, k As Integer
    On Error Resume Next
    xTitleId = "KutoolsforExcel"
    Set WorkRng = Application.Selection
    Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
    Arr = WorkRng.Formula
    For j = 1 To UBound(Arr, 2)
    k = UBound(Arr, 1)
    For i = 1 To UBound(Arr, 1) / 2
    xTemp = Arr(i, j)
    Arr(i, j) = Arr(k, j)
    Arr(k, j) = xTemp
    k = k - 1
    Next
    Next
    WorkRng.Formula = Arr
    End Sub
    Is there an easy way I can make this happen? Thanks for your time on this.
    Attached Files Attached Files
    Last edited by jayclinton; 03-13-2015 at 10:38 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Converting macro from functioning on active sheet to a designated sheet.
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2014, 11:53 PM
  2. Replies: 2
    Last Post: 03-27-2014, 09:16 AM
  3. Need some VBA that attaches an exported module to the active workbook
    By DebbieEdwards in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 10:40 AM
  4. Import a macro (module) into the active Excel workbook
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2010, 10:18 PM
  5. Remove active module in a copy
    By Mehrdad Hakimzadeh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2005, 04:06 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