Results 1 to 1 of 1

Help with If function

Threaded View

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

    Help with If function

    I assume this would be done with a nested if function, but am asking for advice.

    Have large spreadsheet in which I will select a range of numbers to be moved to specific locations.

    These numbers fall into 3 major groups and each major group is further divided into two different subroups.

    I wish the user to enter into a cell -- sheet 2 A10 for example -- a value -- then once the values are picked the macro will look at this A10 value and then move the numbers to my specifiec location. I am copying below the code for an example of this -- the values are arranged accordingly in the next empty cell everytime control a is hit. My question is -- how can I specify where this location is to be based on the value put in A10?
    Thanks for any suggestions and or help with this --

    Keyboard Shortcut: Ctrl+a
    '
         Selection.Copy
        Sheets("Sheet2").Select
        Columns("A:AV").Select
        Selection.ColumnWidth = 12
        Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("A6").Select
        Application.CutCopyMode = False
        ActiveCell.FormulaR1C1 = "=AVERAGE(R[-5]C:R[-1]C)"
        Range("A6").Select
        Selection.AutoFill Destination:=Range("A6:C6"), Type:=xlFillDefault
        Range("A6:C6").Select
        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
        Range("B6").Select
        Selection.Copy
        Range("A30").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
        Range("C6").Select
        Selection.Copy
        Range("A40").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
    End Sub
    Last edited by arlu1201; 02-23-2013 at 01:14 PM. Reason: Use code tags in future.

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