Results 1 to 2 of 2

Thread: Excel - Select Switch Command keeps running

  1. #1
    Join Date
    Oct 2009
    Posts
    3

    Excel - Select Switch Command keeps running

    Hey guys,
    I encountered some problems with select-case. My main situation now is that the case will not stop running. Is it because there are too many tasks in one case? The macro just keeps copying+selecting sheet+pasting. Help is really appreciated. Thanks

  2. #2
    Join Date
    Oct 2009
    Posts
    3

    Re: Excel - Select Switch Command keeps running

    Here is part of my code.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    'Cell G2
    Select Case Range("G2").Value

    Case 1

    Range("A2:F2").Copy
    Sheets("There").Select
    ActiveSheet.Range("A2:F2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    Case 2

    Range("A2:F2").Copy
    Sheets("There").Select
    ActiveSheet.Range("A3:F3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    Case 3

    Range("A2:F2").Copy
    Range("A5:F5").Select
    ActiveSheet.Paste

    End Select

    'Cell G3
    Select Case Range("G3").Value

    Case 1

    Range("A3:F3").Copy
    Sheets("There").Select
    ActiveSheet.Range("A2:F2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    Case 2

    Range("A3:F3").Copy
    Sheets("There").Select
    ActiveSheet.Range("A3:F3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    Case 3

    Range("A3:F3").Copy
    Sheets("There").Select
    ActiveSheet.Range("A4:F4").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    End Select

    End Sub

Similar Threads

  1. How to select all images in spreedsheet at once in Excel
    By Aarti C in forum Windows Software
    Replies: 2
    Last Post: 07-01-2012, 06:08 PM
  2. Wireless select switch software
    By textads in forum Software Development
    Replies: 1
    Last Post: 26-11-2011, 04:11 PM
  3. Select a range of sheets in Excel VBA
    By RyanInt in forum Software Development
    Replies: 6
    Last Post: 16-01-2010, 11:47 AM
  4. How to select Excel cell without mouse
    By Nathen in forum Windows Software
    Replies: 3
    Last Post: 15-07-2009, 10:42 PM
  5. SELECT - Command in SQL
    By Braze in forum Software Development
    Replies: 2
    Last Post: 15-01-2009, 09:12 PM

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
  •  
Page generated in 1,713,972,984.32719 seconds with 17 queries