Results 1 to 2 of 2

Select sheet inside or outside other select

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2007
    Posts
    1

    Select sheet inside or outside other select

    This seems to be quite a unique problem I have, maybe it is a simple problem that no one else has.

    I am trying to copy a value from one sheet and paste it to another sheet but I can not figure out where to put the Sheets("OrderData").Select.
    If I remove it completely then it copies the values to current sheet, OrderForm, because Sheets("OrderForm").Select was used previously.
    As soon as I try and place the OrderData.select in it doesnt work.

    here is a snippet of my code.

    Sheets("OrderData").Select
    
        If Range("A2") = "" Then
            ' if it's the first record to be added simply select a2
            Range("A2").Select
        Else
            'if it's not the first record position to insertion point
            Range("A1").Select
            Selection.End(xlDown).Select
            ActiveCell.Offset(1, 0).Range("A1").Select
        End If
    
        ActiveCell = Date
    
        Sheets("OrderForm").Select
    
        If Range("C17").Value = Range("C18").Value Or Range("C17").Value = Range("C19").Value Or Range("C18").Value = Range("C19").Value Then
        MsgBox "You can not enter duplicate wine cases, please ensure you make unique selections and try again"
        
            Exit Sub
    
        End If
    
        For loopcount = 1 To 3
        
        Sheets("OrderForm").Range("C16").Offset(loopcount, 0).Range("A1").Copy
        Sheets("Price&GiftInfo").Range("RWM").PasteSpecial Paste:=xlValues
        Sheets("OrderForm").Range("E16").Offset(loopcount, 0).Range("A1").Copy
        
     '   Sheets("OrderData").Select
    
       Select Case Range("RWM")
        
            Case "Red"
    
                ActiveCell.Offset(0, 1).Range("A1").PasteSpecial Paste:=xlValues
                ActiveCell.Offset(0, -1).Range("A1").Select
            
            Case "White"
            
                ActiveCell.Offset(0, 2).Range("A1").PasteSpecial Paste:=xlValues
                ActiveCell.Offset(0, -2).Range("A1").Select
            
            Case "Mixed"
            
                ActiveCell.Offset(0, 3).Range("A1").PasteSpecial Paste:=xlValues
                ActiveCell.Offset(0, -3).Range("A1").Select
        End Select
    
        Next loopcount
    I have the Sheets("OrderData").Select currently commented out where I assumed it would usually go.
    Hopefully I have covered everything, I am a bit tired after spending many hours trying this so please excuse my noobishness.
    Last edited by MadRue; 05-27-2007 at 06:42 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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