+ Reply to Thread
Results 1 to 4 of 4

Command Button to copy conetents of one cell to another

  1. #1
    Gazzauk2000
    Guest

    Command Button to copy conetents of one cell to another

    Basically, i have a table of customers details, and i need to make a command
    button using VB code or anything else that will allow me to slect the ID of a
    customer, and the details of the custoemr to be insrted into other cells on a
    different sheet (which is an estimate and invoice ). Any help please?

  2. #2
    Ron de Bruin
    Guest

    Re: Command Button to copy conetents of one cell to another

    Hi Gazzauk2000

    You can use Data>AutoFilter to filter on your ID and then copy the Visible cells

    Sub Copy_with_Autofilter()
    Dim rng As Range

    With ActiveSheet.AutoFilter.Range
    On Error Resume Next
    Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
    .SpecialCells(xlCellTypeVisible)
    On Error GoTo 0
    If Not rng Is Nothing Then rng.EntireRow.Copy _
    Sheets("Sheet2").Range("A1")
    End With
    End Sub



    Try this to copy the activecell row to Sheets("Sheet2").Range("A1")

    Sub copy_6()
    Dim destrange As Range
    If Selection.Areas.Count > 1 Then Exit Sub
    Set destrange = Sheets("Sheet2").Range("A1")
    ActiveCell.EntireRow.Copy destrange
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Gazzauk2000" <[email protected]> wrote in message news:[email protected]...
    > Basically, i have a table of customers details, and i need to make a command
    > button using VB code or anything else that will allow me to slect the ID of a
    > customer, and the details of the custoemr to be insrted into other cells on a
    > different sheet (which is an estimate and invoice ). Any help please?




  3. #3
    Gazzauk2000
    Guest

    Re: Command Button to copy conetents of one cell to another

    This does not work. What i need is a combo-box that allows you to select a
    custoemrs ID, then it copies the custoemr information which is currently in
    an excel spreadsheet onto the estimate which is on the next sheet. However
    information from different columns go into different cells on the estimate. I
    may have to show you what i mean, do you have msn messenger?

    "Ron de Bruin" wrote:

    > Hi Gazzauk2000
    >
    > You can use Data>AutoFilter to filter on your ID and then copy the Visible cells
    >
    > Sub Copy_with_Autofilter()
    > Dim rng As Range
    >
    > With ActiveSheet.AutoFilter.Range
    > On Error Resume Next
    > Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
    > .SpecialCells(xlCellTypeVisible)
    > On Error GoTo 0
    > If Not rng Is Nothing Then rng.EntireRow.Copy _
    > Sheets("Sheet2").Range("A1")
    > End With
    > End Sub
    >
    >
    >
    > Try this to copy the activecell row to Sheets("Sheet2").Range("A1")
    >
    > Sub copy_6()
    > Dim destrange As Range
    > If Selection.Areas.Count > 1 Then Exit Sub
    > Set destrange = Sheets("Sheet2").Range("A1")
    > ActiveCell.EntireRow.Copy destrange
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Gazzauk2000" <[email protected]> wrote in message news:[email protected]...
    > > Basically, i have a table of customers details, and i need to make a command
    > > button using VB code or anything else that will allow me to slect the ID of a
    > > customer, and the details of the custoemr to be insrted into other cells on a
    > > different sheet (which is an estimate and invoice ). Any help please?

    >
    >
    >


  4. #4
    Ron de Bruin
    Guest

    Re: Command Button to copy conetents of one cell to another

    Hi Gazzauk2000

    Send me your example workbook private and I look at it

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Gazzauk2000" <[email protected]> wrote in message news:[email protected]...
    > This does not work. What i need is a combo-box that allows you to select a
    > custoemrs ID, then it copies the custoemr information which is currently in
    > an excel spreadsheet onto the estimate which is on the next sheet. However
    > information from different columns go into different cells on the estimate. I
    > may have to show you what i mean, do you have msn messenger?
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi Gazzauk2000
    >>
    >> You can use Data>AutoFilter to filter on your ID and then copy the Visible cells
    >>
    >> Sub Copy_with_Autofilter()
    >> Dim rng As Range
    >>
    >> With ActiveSheet.AutoFilter.Range
    >> On Error Resume Next
    >> Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
    >> .SpecialCells(xlCellTypeVisible)
    >> On Error GoTo 0
    >> If Not rng Is Nothing Then rng.EntireRow.Copy _
    >> Sheets("Sheet2").Range("A1")
    >> End With
    >> End Sub
    >>
    >>
    >>
    >> Try this to copy the activecell row to Sheets("Sheet2").Range("A1")
    >>
    >> Sub copy_6()
    >> Dim destrange As Range
    >> If Selection.Areas.Count > 1 Then Exit Sub
    >> Set destrange = Sheets("Sheet2").Range("A1")
    >> ActiveCell.EntireRow.Copy destrange
    >> End Sub
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "Gazzauk2000" <[email protected]> wrote in message news:[email protected]...
    >> > Basically, i have a table of customers details, and i need to make a command
    >> > button using VB code or anything else that will allow me to slect the ID of a
    >> > customer, and the details of the custoemr to be insrted into other cells on a
    >> > different sheet (which is an estimate and invoice ). Any help please?

    >>
    >>
    >>




+ 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