Consulting

Results 1 to 3 of 3

Thread: VBA User Form To Select Column To Copy Cells Into If Destination Is Blank

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    VBA User Form To Select Column To Copy Cells Into If Destination Is Blank

    I attached the worksheet with a ton of macros that I am trying to cannibalize from and get it to work.

    Non-VBA CTRL G is easy, but it still takes a coupe repetitive steps that should be able to be automated.

    This code works if I specify the "=RC2" formula at the end. I would like a user form to pop up and list which column to select.

    I have a ton of garbage in Module 1 that I have tried to get to work, but I hit a wall.


    Sub CopyEmptyCellsOver()
    '' without VBA, CTRL+G and click on special.

    '' Select blank and press OK.

    '' In formula bar, type "=" and CRTL+click thefirst

    '' Cell where the data starts and CRTL+enter

    Dim rRange AsRange

    On Error ResumeNext

    Set rRange =Application.InputBox(Prompt:="Select Column", _

    Default:=ActiveCell.EntireColumn.Address, Type:=8)

    On Error GoTo 0

    Selection.SpecialCells(xlCellTypeBlanks).Select

    Application.CutCopyMode = False

    Selection.FormulaR1C1 = "=RC[2]"





    End Sub
    Thanks In Advance!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •