+ Reply to Thread
Results 1 to 3 of 3

Nested if question

  1. #1
    Registered User
    Join Date
    02-17-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Nested if question

    I am uncertain if nested if is the correct way to handle this -- what I want to do -- is following:
    Based on the contents of sheet 2 A11 -- I want A6 to be pasted into a different spot -- if A11=1, then in A20 -- if A11 =2 then H20, If A11=3 then N20, If A11 = 4 .... total of 6 choices -- i.e. the A11 choices range from 1 through 6.

    The code below puts in in A20 -- so need something after the second line in the code so that the correct place is chosen. Suggestions on how to do this? Thanks!!

    Range("A6").Select
    Selection.Copy
    Range("A20").Select
    'For next cell in the same column (A)
    While ActiveCell.Value <> ""
    ActiveCell.Offset(1, 0).Select
    Wend

    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    'Clear the clipboard
    Application.CutCopyMode = False

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,596

    Re: Nested if question

    Untested, but try:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Nested if question

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-23-2013 at 07:29 PM.

+ Reply to Thread

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