Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copy 'value' of cell to other cell, same sheet after entering value

Helo

I think the Subject says it all. I'm putting values into a series of cells in a
column, about 10 different rows, and there are cells down below in that same
column of the same sheet that are USUALLY the same value. Rather than having to
re-type them again, I'd like to have them copied to the target cells as I type
them in the first group of cells, but I still want to be able to override
(over-write) the values that were copied to the target cells, as they are not
ALWAYS the same.

Thanks

Harry Fine



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy 'value' of cell to other cell, same sheet after entering value

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 3 then
application.EnableEvents = False
target.Resize(10,1).Value = Target.Value
application.EnableEvents = True
End if
End Sub

Change the 10 to the number of row you want to fill. Change 3 to reflect
the column where you want this behavior.

Right click on the sheet tab of this worksheet and select view code. Paste
in code similar to the above.

another approach is to select all the cells to be filled, go to the formula
bar and enter the data, then do Ctrl+Enter rather than just enter.

--
regards,
Tom Ogilvy

"Harry" wrote in message
.. .
Helo

I think the Subject says it all. I'm putting values into a series of

cells in a
column, about 10 different rows, and there are cells down below in that

same
column of the same sheet that are USUALLY the same value. Rather than

having to
re-type them again, I'd like to have them copied to the target cells as I

type
them in the first group of cells, but I still want to be able to override
(over-write) the values that were copied to the target cells, as they are

not
ALWAYS the same.

Thanks

Harry Fine





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copy 'value' of cell to other cell, same sheet after entering value

Tom, this is great, and I am greatful, but....where do I put this routine? Is
it a Visual Basic script, or a Macro. Where do I start.

Harry


On Mon, 14 Feb 2005 10:38:37 -0500, "Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 3 then
application.EnableEvents = False
target.Resize(10,1).Value = Target.Value
application.EnableEvents = True
End if
End Sub

Change the 10 to the number of row you want to fill. Change 3 to reflect
the column where you want this behavior.

Right click on the sheet tab of this worksheet and select view code. Paste
in code similar to the above.

another approach is to select all the cells to be filled, go to the formula
bar and enter the data, then do Ctrl+Enter rather than just enter.

--
regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Helo

I think the Subject says it all. I'm putting values into a series of

cells in a
column, about 10 different rows, and there are cells down below in that

same
column of the same sheet that are USUALLY the same value. Rather than

having to
re-type them again, I'd like to have them copied to the target cells as I

type
them in the first group of cells, but I still want to be able to override
(over-write) the values that were copied to the target cells, as they are

not
ALWAYS the same.

Thanks

Harry Fine






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy 'value' of cell to other cell, same sheet after entering value

As I said:

Right click on the sheet tab of this worksheet and select view code. Paste
in code similar to the above.


See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

for tutorials/ getting started with macros:


David McRitchie's site


http://www.mvps.org/dmcritchie/excel....htm#tutorials


the vba tutorials are below the excel tutorials.


This has good info as well (for Excel)



http://msdn.microsoft.com/office/und.../odc_super.asp

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards,
Tom Ogilvy


"Harry" wrote in message
.. .
Tom, this is great, and I am greatful, but....where do I put this routine?

Is
it a Visual Basic script, or a Macro. Where do I start.

Harry


On Mon, 14 Feb 2005 10:38:37 -0500, "Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 3 then
application.EnableEvents = False
target.Resize(10,1).Value = Target.Value
application.EnableEvents = True
End if
End Sub

Change the 10 to the number of row you want to fill. Change 3 to reflect
the column where you want this behavior.

Right click on the sheet tab of this worksheet and select view code.

Paste
in code similar to the above.

another approach is to select all the cells to be filled, go to the

formula
bar and enter the data, then do Ctrl+Enter rather than just enter.

--
regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Helo

I think the Subject says it all. I'm putting values into a series of

cells in a
column, about 10 different rows, and there are cells down below in that

same
column of the same sheet that are USUALLY the same value. Rather than

having to
re-type them again, I'd like to have them copied to the target cells as

I
type
them in the first group of cells, but I still want to be able to

override
(over-write) the values that were copied to the target cells, as they

are
not
ALWAYS the same.

Thanks

Harry Fine








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copy 'value' of cell to other cell, same sheet after entering value

Sorry Tom, I missed that. But it can't possibly work. It will need to know the
starting cell and range to grab it from (Column K, rows 16-22) and then where to
start copying the data (Column K, rows 48 - 54)

Harry


On Mon, 14 Feb 2005 11:53:03 -0500, "Tom Ogilvy" wrote:

As I said:

Right click on the sheet tab of this worksheet and select view code. Paste
in code similar to the above.


See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

for tutorials/ getting started with macros:


David McRitchie's site


http://www.mvps.org/dmcritchie/excel....htm#tutorials


the vba tutorials are below the excel tutorials.


This has good info as well (for Excel)



http://msdn.microsoft.com/office/und.../odc_super.asp

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards,
Tom Ogilvy


"Harry" wrote in message
. ..
Tom, this is great, and I am greatful, but....where do I put this routine?

Is
it a Visual Basic script, or a Macro. Where do I start.

Harry


On Mon, 14 Feb 2005 10:38:37 -0500, "Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 3 then
application.EnableEvents = False
target.Resize(10,1).Value = Target.Value
application.EnableEvents = True
End if
End Sub

Change the 10 to the number of row you want to fill. Change 3 to reflect
the column where you want this behavior.

Right click on the sheet tab of this worksheet and select view code.

Paste
in code similar to the above.

another approach is to select all the cells to be filled, go to the

formula
bar and enter the data, then do Ctrl+Enter rather than just enter.

--
regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Helo

I think the Subject says it all. I'm putting values into a series of
cells in a
column, about 10 different rows, and there are cells down below in that
same
column of the same sheet that are USUALLY the same value. Rather than
having to
re-type them again, I'd like to have them copied to the target cells as

I
type
them in the first group of cells, but I still want to be able to

override
(over-write) the values that were copied to the target cells, as they

are
not
ALWAYS the same.

Thanks

Harry Fine











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy 'value' of cell to other cell, same sheet after entering value

That's correct Harry - but it works for the way I interpreted your
description. Have you ever heard the story of the 3 blind men trying to
describe an elephant.

so now, based on what you have told us so far

Private Sub Worksheet_Change(ByVal Target As Range)
if target.columns.count 1 then exit sub
if target.column < 11 then exit sub
if Target(1).Row = 16 and Target(1).Row <= 22 then
application.EnableEvents = False
me.Range("K48:K54").Value = _
me.Range("K16:K22").Value
application.EnableEvents = True
End if
End Sub

--
Regards,
Tom Ogilvy


"Harry" wrote in message
.. .
Sorry Tom, I missed that. But it can't possibly work. It will need to

know the
starting cell and range to grab it from (Column K, rows 16-22) and then

where to
start copying the data (Column K, rows 48 - 54)

Harry


On Mon, 14 Feb 2005 11:53:03 -0500, "Tom Ogilvy" wrote:

As I said:

Right click on the sheet tab of this worksheet and select view code.

Paste
in code similar to the above.


See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

for tutorials/ getting started with macros:


David McRitchie's site


http://www.mvps.org/dmcritchie/excel....htm#tutorials


the vba tutorials are below the excel tutorials.


This has good info as well (for Excel)




http://msdn.microsoft.com/office/und...tarted/default

..aspx?pull=/library/en-us/odc_xl2003_ta/html/odc_super.asp

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards,
Tom Ogilvy


"Harry" wrote in message
. ..
Tom, this is great, and I am greatful, but....where do I put this

routine?
Is
it a Visual Basic script, or a Macro. Where do I start.

Harry


On Mon, 14 Feb 2005 10:38:37 -0500, "Tom Ogilvy"

wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 3 then
application.EnableEvents = False
target.Resize(10,1).Value = Target.Value
application.EnableEvents = True
End if
End Sub

Change the 10 to the number of row you want to fill. Change 3 to

reflect
the column where you want this behavior.

Right click on the sheet tab of this worksheet and select view code.

Paste
in code similar to the above.

another approach is to select all the cells to be filled, go to the

formula
bar and enter the data, then do Ctrl+Enter rather than just enter.

--
regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Helo

I think the Subject says it all. I'm putting values into a series

of
cells in a
column, about 10 different rows, and there are cells down below in

that
same
column of the same sheet that are USUALLY the same value. Rather

than
having to
re-type them again, I'd like to have them copied to the target cells

as
I
type
them in the first group of cells, but I still want to be able to

override
(over-write) the values that were copied to the target cells, as

they
are
not
ALWAYS the same.

Thanks

Harry Fine











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 rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Copy last cell with data in column E on one sheet to cell on anoth Seahawk Excel Worksheet Functions 7 May 7th 09 02:52 AM
copy a sum in cell on sheet 1 (not formula) to cell on sheet 2 John Excel Worksheet Functions 1 March 2nd 09 12:01 AM
copy a sum in cell on sheet 1 (not formula) to cell on sheet 2 Eduardo Excel Worksheet Functions 0 February 27th 09 05:19 PM
Retreiving a sheet by entering a value on a cell AHenry Excel Discussion (Misc queries) 0 March 16th 06 06:52 AM


All times are GMT +1. The time now is 02:27 PM.

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

About Us

"It's about Microsoft Excel"