+ Reply to Thread
Results 1 to 3 of 3

How to deactivate selection in Macro button

Hybrid View

tnuis How to deactivate selection... 09-03-2013, 03:19 PM
Norie Re: How to deactivate... 09-03-2013, 03:25 PM
tnuis Re: How to deactivate... 09-03-2013, 03:29 PM
  1. #1
    Forum Contributor
    Join Date
    09-20-2012
    Location
    Norge
    MS-Off Ver
    Excel 2007
    Posts
    114

    How to deactivate selection in Macro button

    Hello,

    How do I deselect after the code is finished copying and pasting in this Macro Button?

    Sub Nullstill()
         'Start over with the items
    If MsgBox("Dette vil nullstille alle varelinjer." & vbNewLine & vbNewLine & "Er du sikker?", vbOKCancel) = vbCancel Then Exit Sub
    
       Range("BQ13:BZ40").Copy
       Range("C13:L40").Select
       ActiveSheet.Paste
          
        
    End Sub

    I tried adding Application.CutCopyMode = False under ActiveSheet.Paste but it makes no difference...


    Thanks in advance

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

    Re: How to deactivate selection in Macro button

    Try this.
    Sub Nullstill()
         'Start over with the items
    If MsgBox("Dette vil nullstille alle varelinjer." & vbNewLine & vbNewLine & "Er du sikker?", vbOKCancel) = vbCancel Then Exit Sub
    
       Range("BQ13:BZ40").Copy Range("C13:L40")
        
    End Sub
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    09-20-2012
    Location
    Norge
    MS-Off Ver
    Excel 2007
    Posts
    114

    Re: How to deactivate selection in Macro button

    Quote Originally Posted by Norie View Post
    Try this.
    Sub Nullstill()
         'Start over with the items
    If MsgBox("Dette vil nullstille alle varelinjer." & vbNewLine & vbNewLine & "Er du sikker?", vbOKCancel) = vbCancel Then Exit Sub
    
       Range("BQ13:BZ40").Copy Range("C13:L40")
        
    End Sub

    And offcourse the solution was simple....


    Thank you so much Norie. That did the trick

+ 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] UserForm Option Button selection to determine which macro to run.
    By strud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 08:53 AM
  2. Replies: 5
    Last Post: 05-04-2013, 01:42 PM
  3. [SOLVED] Macro to change shape/macro button colours based on selection
    By deanstein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 08:26 AM
  4. Deactivate X (Close button) when using FileDialog
    By Fredriksson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2007, 07:18 PM
  5. activate/deactivate button with macro at given condition
    By arcq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2005, 02: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