Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,280 of 10,840    |
|    Steve Gerrard to Scott Beavers    |
|    Re: Using "IF" Statement    |
|    11 Mar 05 17:39:40    |
   
   From: mynamehere@comcast.net   
      
   "Scott Beavers" wrote in message   
   news:p-KdnRsPr_34d6zfRVn-uw@cmspan.net...   
   > I'm trying to create a form in Excel to sort from the form and take the data   
   > to another worksheet.   
   > I am very new to this and any help would be appreciated.   
   >   
   > I have a value in a cell that will direct what sheet I want the cells copied   
   > to, so I thought I could use an If statement but have been unable to right   
   > the code properly, ie...   
   >   
   > If "f2" = 1 Then   
      
   The string "f2" is never equal to the integer 1 :-)   
      
   I assume what you mean is something more like   
      
    If ActiveSheet.Range("F2").Value = 1 Then   
      
   Or perhaps better would be   
      
    vPick = ActiveSheet.Range("F2").Value   
      
    If vPick = 1 Then   
      
   That way you don't get scrambled when the active sheet gets changed.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca