+ Reply to Thread
Results 1 to 2 of 2

RE: macro to transfer info

  1. #1
    Brassman
    Guest

    RE: macro to transfer info

    Try this:

    Copy this code into the code window for Sheet1
    -----------------------------------------------------------------------------------------
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    Boolean)
    Dim GoOn
    If Target.Column = 1 And Target.Value <> "" Then
    GoOn = MsgBox("Copy Vendor Info?", vbOKCancel)
    If GoOn <> vbOK Then
    Exit Sub
    Else
    CopyVendorInfo
    End If
    End If

    End Sub
    -----------------------------------------------------------------
    Copy this code into a regular module
    -----------------------------------------------------------------------------------------
    Sub CopyVendorInfo()
    Dim BlankCell As Integer

    ActiveCell.EntireRow.Copy
    Sheet2.Select
    BlankCell = Application.WorksheetFunction.CountA(Sheet2.Range("A:A")) + 1
    Sheet2.Cells(BlankCell, 1).Select
    Selection.PasteSpecial (xlPasteValues)
    Application.CutCopyMode = False

    End Sub
    ------------------------------------------------------------------------------------------
    Maybe not the best way to do it, but it works.
    "Larry" wrote:

    > I need a macro that will let me do this: When I click on a vendor ID number
    > in column A of sheet 1, I want all vendor information on that row to be
    > automatically copied to the next empty row on sheet 2, including the vendor
    > ID number, in the appropriate cells. Can you help? Thanks!


  2. #2
    Larry
    Guest

    RE: macro to transfer info

    Man, this is really close. It does exactly what I asked about. However, I
    neglected to provide specific information you should have had. Sheet2 is
    named 'Field Activity Report'. I renamed it to Sheet2 to make the macro
    work, but it really needs to be called "Field Activity Report'. Information
    copied onto the next blank row of 'Field Activity Report' needs to begin on
    column d, not column a. Once the user has pressed OK on the message box, the
    macro needs to go back to sheet1 automatically after the information is
    entered onto the 'Filed Activity Report'. If you can help me tweek this, it
    would be greatly appreciated. You did a great job! Thanks!

    "Brassman" wrote:

    > Try this:
    >
    > Copy this code into the code window for Sheet1
    > -----------------------------------------------------------------------------------------
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    > Boolean)
    > Dim GoOn
    > If Target.Column = 1 And Target.Value <> "" Then
    > GoOn = MsgBox("Copy Vendor Info?", vbOKCancel)
    > If GoOn <> vbOK Then
    > Exit Sub
    > Else
    > CopyVendorInfo
    > End If
    > End If
    >
    > End Sub
    > -----------------------------------------------------------------
    > Copy this code into a regular module
    > -----------------------------------------------------------------------------------------
    > Sub CopyVendorInfo()
    > Dim BlankCell As Integer
    >
    > ActiveCell.EntireRow.Copy
    > Sheet2.Select
    > BlankCell = Application.WorksheetFunction.CountA(Sheet2.Range("A:A")) + 1
    > Sheet2.Cells(BlankCell, 1).Select
    > Selection.PasteSpecial (xlPasteValues)
    > Application.CutCopyMode = False
    >
    > End Sub
    > ------------------------------------------------------------------------------------------
    > Maybe not the best way to do it, but it works.
    > "Larry" wrote:
    >
    > > I need a macro that will let me do this: When I click on a vendor ID number
    > > in column A of sheet 1, I want all vendor information on that row to be
    > > automatically copied to the next empty row on sheet 2, including the vendor
    > > ID number, in the appropriate cells. Can you help? Thanks!


+ 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