Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button to copy conetents of one cell to another
Hi Gazzauk2000
You can use DataAutoFilter 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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 DataAutoFilter 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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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 DataAutoFilter 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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy cell by command button | Excel Worksheet Functions | |||
Using Command Button to copy cells | Excel Discussion (Misc queries) | |||
Copy down command button | Excel Programming | |||
copy & paste command button | Excel Programming | |||
copy and delete command button | Excel Programming |