Excel Macro Copy cells and pastes them in another sheet

S

sam99

Hi All,
I am trying to create a macro that copies cells and past C16, C18, C20
E16, E18, G16, G18 in another sheet (sheet1) in the next blank row an
save the sheet( copy value only).
File is attached
Thanx for the hel

+-------------------------------------------------------------------
|Filename: test macro.zip
|Download: http://www.excelbanter.com/attachment.php?attachmentid=444
+-------------------------------------------------------------------
 
V

Vacuum Sealed

Hi All,
I am trying to create a macro that copies cells and past C16, C18, C20,
E16, E18, G16, G18 in another sheet (sheet1) in the next blank row and
save the sheet( copy value only).
File is attached
Thanx for the help


+-------------------------------------------------------------------+
|Filename: test macro.zip |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=444|
+-------------------------------------------------------------------+
Hi

Here's a quick solution for you, not pretty, but it does what you want.

As you have not given the destination cells you will have to changed the
tSht.Range() refs to suit...

HTH
Mick.

Sub CopyCells()

Dim sSht As Worksheet, tSht As Worksheet

Set sSht = Worksheets("Ref1")
Set tSht = Worksheets("Sheet1")

tSht.Range("A2").Value = sSht.Range("C16").Value
tSht.Range("A3").Value = sSht.Range("C18").Value
tSht.Range("A4").Value = sSht.Range("C20").Value
tSht.Range("A5").Value = sSht.Range("E16").Value
tSht.Range("A6").Value = sSht.Range("E18").Value
tSht.Range("A7").Value = sSht.Range("G16").Value
tSht.Range("A8").Value = sSht.Range("G18").Value

End Sub
 
S

sam99

Thanx
it is solved and I cross posted this question but I didn't know
shouldn't do that.
On 1/07/2012 7:42 PM, sam99 wrote:-
Hi

Here's a quick solution for you, not pretty, but it does what you want.

As you have not given the destination cells you will have to changed th

tSht.Range() refs to suit...

HTH
Mick.

Sub CopyCells()

Dim sSht As Worksheet, tSht As Worksheet

Set sSht = Worksheets("Ref1")
Set tSht = Worksheets("Sheet1")

tSht.Range("A2").Value = sSht.Range("C16").Value
tSht.Range("A3").Value = sSht.Range("C18").Value
tSht.Range("A4").Value = sSht.Range("C20").Value
tSht.Range("A5").Value = sSht.Range("E16").Value
tSht.Range("A6").Value = sSht.Range("E18").Value
tSht.Range("A7").Value = sSht.Range("G16").Value
tSht.Range("A8").Value = sSht.Range("G18").Value

End Su

+-------------------------------------------------------------------
+-------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top