+ Reply to Thread
Results 1 to 4 of 4

Selection Offset Help

  1. #1
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Selection Offset Help

    I have a spreadsheet where I need to enter man new formulas. I have written a code to help me in the process to speed things up just a little bit. I think there could be a way to speed things up significantly with a better code.
    The code takes the active cell and makes it equal to a formula based on the number written a few columns to the left. Those columns are just numbers that are related to the tab names in my workbook. All the tab names are numbers ranging from 1 to 150. Here is my code:
    PHP Code: 
    Sub Task()
    'ctrl+d
    ActiveCell.Value = "='" & ActiveCell.Offset(0, -3) & "'!$B$11"
    End Sub 
    I want to do the same action but instead of going cell by cell, I want to select a column range and run the macro for many cells at once.
    Last edited by yohanmcdonald; 08-03-2017 at 09:47 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Selection Offset Help

    Perhaps you should look at using INDIRECT?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,447

    Re: Selection Offset Help

    Hi,

    Something like this should get you started.

    Please Login or Register  to view this content.
    Last edited by sweep; 08-03-2017 at 09:43 AM.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    10-17-2014
    Location
    Wausau, WI
    MS-Off Ver
    2014
    Posts
    17

    Re: Selection Offset Help

    Thank you!! I modified it to work for all the tasks I needed done.

+ 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. Offset selection based on selected cells not just activecell
    By sabin348 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2015, 12:20 PM
  2. Offset a selection
    By morangeman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 01:00 AM
  3. [SOLVED] Offset not working for current selection
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2013, 01:48 PM
  4. Searching for an Offset Value based on Combo Box Selection
    By CaddyMatt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2012, 01:33 PM
  5. Use a Drop down selection and count how many in column, then offset and add 1
    By v2jtb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2012, 07:07 PM
  6. Offset from Max Value in non-array Cell selection
    By SubjectEgo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-24-2008, 03:28 PM
  7. type missmatch on Selection.Offset
    By webby2006 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2006, 10:44 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