|
| ||||||||||
| Tags: excel, excel 2007 |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Excel - Select Switch Command keeps running
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
| |||
| |||
| 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 |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Excel - Select Switch Command keeps running" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to select all images in spreedsheet at once in Excel | Aarti C | Windows Software | 2 | 07-01-2012 05:08 PM |
| Wireless select switch software | textads | Software Development | 1 | 26-11-2011 03:11 PM |
| Select a range of sheets in Excel VBA | RyanInt | Software Development | 6 | 16-01-2010 10:47 AM |
| How to select Excel cell without mouse | Nathen | Windows Software | 3 | 15-07-2009 10:42 PM |
| SELECT - Command in SQL | Braze | Software Development | 2 | 15-01-2009 08:12 PM |