Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to make a funtion (because I am lazy, and there are about 3k
worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub SetCellValue()
'Sets current cell value to that of column D of the same row ActiveCell.Value = ActiveSheet.Cells(ActiveCell.Row, 4).Value End Sub Vaya con Dios, Chuck, CABGx3 "W.Easton" wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assign this to a button.
Sub copyit() n = ActiveCell.Row With ActiveCell ..Value = Excel.Range("D" & n).Value End With End Sub OR Double-click on a cell...........no button needed. Private Sub Worksheet_BeforeDoubleClick(ByVal _ Target As Range, Cancel As Boolean) n = Target.Row With Target ..Value = Excel.Range("D" & n).Value End With SendKeys "{ENTER}", True End Sub The copyit macro will be pasted into a general module. The BeforeDoubleClick event code will be pasted into a sheet module. Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:56:02 -0800, W.Easton <-=spam=- at meleetech [,] com wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have placed an example of what you are looking for at
http://www.HelpExcel.com/examples The name of the spreadsheet is copyColumn.xls -- http://HelpExcel.com "W.Easton" wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This almost worked, but I replaced your
...Value = Excel.Range("D" & n).Value with ActiveCell.Value = ActiveSheet.Cells(ActiveCell.Row, 4).Value (posted by CLR above) and it worked great, the double click function makes this really handy too. Thank you, W. Clay Easton "Gord Dibben" wrote: Assign this to a button. Sub copyit() n = ActiveCell.Row With ActiveCell ..Value = Excel.Range("D" & n).Value End With End Sub OR Double-click on a cell...........no button needed. Private Sub Worksheet_BeforeDoubleClick(ByVal _ Target As Range, Cancel As Boolean) n = Target.Row With Target ..Value = Excel.Range("D" & n).Value End With SendKeys "{ENTER}", True End Sub The copyit macro will be pasted into a general module. The BeforeDoubleClick event code will be pasted into a sheet module. Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:56:02 -0800, W.Easton <-=spam=- at meleetech [,] com wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you, I combined your ActiveCell line with what Gord posted below and it
works great. I really appreciate the fast response. Thank you, W. Clay Easton -- Mistakes have been made, others will be blamed "CLR" wrote: Sub SetCellValue() 'Sets current cell value to that of column D of the same row ActiveCell.Value = ActiveSheet.Cells(ActiveCell.Row, 4).Value End Sub Vaya con Dios, Chuck, CABGx3 "W.Easton" wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Happy to help, and thanks for the feedback..........
Vaya con Dios, Chuck, CABGx3 "W.Easton" wrote: Thank you, I combined your ActiveCell line with what Gord posted below and it works great. I really appreciate the fast response. Thank you, W. Clay Easton -- Mistakes have been made, others will be blamed "CLR" wrote: Sub SetCellValue() 'Sets current cell value to that of column D of the same row ActiveCell.Value = ActiveSheet.Cells(ActiveCell.Row, 4).Value End Sub Vaya con Dios, Chuck, CABGx3 "W.Easton" wrote: I am trying to make a funtion (because I am lazy, and there are about 3k worth of lines that I need to go through) that will copy a specific cell to the selected cell Basically what I would like it to do is when I select a cell and and hit a button it would copy the contents from the current row, column 4 to the selected cell. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert date | Excel Worksheet Functions | |||
Paste under selected cell | Excel Discussion (Misc queries) | |||
Help with this conditional IF statement | Excel Discussion (Misc queries) | |||
linking a cell with a specific letter value to a cell with a formu | Excel Worksheet Functions | |||
how read value from last selected cell? It is possible? how get adress last selected cell? | New Users to Excel |