Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using a macro to copy cells from one sheet to another

I have a worksheet that uses vlookup to read values from a
input sheet based on date. From the summary sheet I want
to use the date entered and copy a row of cells to another
sheet where the dates are in column A and paste the values
of the coppied cells according to the date entered on the
summary page. When pasting the data I want to use the
value function in order to preserve the data as it is
calculated based on the specific date entered. I want to
use a option button and assign the macro to it so when I
click on the button the cels are coppied to the associated
date on the other sheet within the workbook. Any input on
this would be greatly appreciated.

Tony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default using a macro to copy cells from one sheet to another

You need to find the rows where the date in one sheet
matches the date in the other sheet. For this you need
the find command as below:

With ActiveSheet.Range("A1:A500")
Set c = .Find(date variable, LookIn:=xlValues,
lookat:=xlWhole)

If Not c Is Nothing Then

then all the copy and paste commands. The paste command
needs to paste values. such as
ActiveSheet.Range(the range of cells to be copied).Copy

sheets("name of sheet to take the new data").range(cell
address for where to paste the data).PasteSpecial
paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End With


Hope this points you in the right direction.
BOL
DavidC
-----Original Message-----
I have a worksheet that uses vlookup to read values from

a
input sheet based on date. From the summary sheet I want
to use the date entered and copy a row of cells to

another
sheet where the dates are in column A and paste the

values
of the coppied cells according to the date entered on the
summary page. When pasting the data I want to use the
value function in order to preserve the data as it is
calculated based on the specific date entered. I want to
use a option button and assign the macro to it so when I
click on the button the cels are coppied to the

associated
date on the other sheet within the workbook. Any input

on
this would be greatly appreciated.

Tony
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default using a macro to copy cells from one sheet to another

Thanks David I will give it a shot.

Toony
-----Original Message-----
You need to find the rows where the date in one sheet
matches the date in the other sheet. For this you need
the find command as below:

With ActiveSheet.Range("A1:A500")
Set c = .Find(date variable, LookIn:=xlValues,
lookat:=xlWhole)

If Not c Is Nothing Then

then all the copy and paste commands. The paste command
needs to paste values. such as
ActiveSheet.Range(the range of cells to be copied).Copy

sheets("name of sheet to take the new data").range(cell
address for where to paste the data).PasteSpecial
paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End With


Hope this points you in the right direction.
BOL
DavidC
-----Original Message-----
I have a worksheet that uses vlookup to read values

from
a
input sheet based on date. From the summary sheet I

want
to use the date entered and copy a row of cells to

another
sheet where the dates are in column A and paste the

values
of the coppied cells according to the date entered on

the
summary page. When pasting the data I want to use the
value function in order to preserve the data as it is
calculated based on the specific date entered. I want

to
use a option button and assign the macro to it so when

I
click on the button the cels are coppied to the

associated
date on the other sheet within the workbook. Any input

on
this would be greatly appreciated.

Tony
.

.

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 Sheet to new Sheet and clear cells on original sheets Boiler-Todd Excel Discussion (Misc queries) 7 September 23rd 09 10:02 PM
Macro-Copy various cells in sheet1 into next available row in sheet 2 lunker55 Excel Discussion (Misc queries) 7 October 21st 05 11:05 PM
How to create a Macro to Copy Information in one sheet to another sheet. poppy Excel Programming 3 July 28th 04 07:26 AM
Need Macro to Copy Visible Cells to New Sheet Tom Ogilvy Excel Programming 0 July 15th 03 04:05 PM
Need Macro to Copy Visible Cells to New Sheet Don Guillett[_4_] Excel Programming 0 July 15th 03 03:56 PM


All times are GMT +1. The time now is 01:17 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"