+ Reply to Thread
Results 1 to 3 of 3

Optimize code without Select

  1. #1
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Optimize code without Select

    I have tried to get this code to work without the select, but I can't
    This is the code that works:
    Please Login or Register  to view this content.
    This is one of the ways I tried without it working

    Please Login or Register  to view this content.
    Is there any way without select ?

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Optimize code without Select

    This is code without context all the macro does is select a cell and then call another macro..

    But just for the "lesson" on how to not have multiple selects

    First your code, if we ignore that a With-end with is a bit pointless with one property it only has a small misstake,
    it needs a point before .Range("C6")
    Please Login or Register  to view this content.
    The simplest code for select C6 on TilBeregning is:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Optimize code without Select

    Pretty sure you can't select a cell unless it is on the active sheet.

    But, as that's what you're trying to avoid, you could look at Application.GoTo.

    Other than that, we'd need to see more code.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. [SOLVED] Optimize my VBA code
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-07-2019, 11:25 AM
  2. Optimize Code by avoiding Select-Method
    By JonasBig2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2018, 10:07 AM
  3. Need to optimize the code
    By pm.patel189 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2018, 01:06 PM
  4. Optimize a code
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2015, 05:31 PM
  5. Optimize code
    By DarkKnightLupo in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-19-2014, 08:58 AM
  6. Optimize code
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2011, 03:35 PM
  7. Optimize VBA code
    By doodlebug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2007, 07:53 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