Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy cell by command button kalpesh Excel Worksheet Functions 1 December 28th 11 08:41 PM
Using Command Button to copy cells Pennington Excel Discussion (Misc queries) 1 April 29th 05 02:30 AM
Copy down command button sowetoddid[_49_] Excel Programming 1 June 16th 04 03:48 PM
copy & paste command button RENEE RINEHART Excel Programming 4 April 9th 04 06:10 AM
copy and delete command button Mark Kubicki Excel Programming 0 October 6th 03 08:20 PM


All times are GMT +1. The time now is 08:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"