Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Copying and pasting with a macro

Hi!

I posted this up yesterday and am very pleased with the corrections I got. I
do have another question though:

How can I make it so that the copied information is inserted into sheet 2
and takes on the format of the target cell rather than keeping the original
one?


Sub Wombat()

Sheets("1").Cells(3, 12).Select
x = 3
y = 24
Do Until Cells(x, 12).Value = "END"
If Cells(x, 12).Value < "" Then
Cells(x, 12).Copy Sheets("2").Cells(y, 1)
x = x + 1
y = y + 1
Else
x = x + 1
End If
Loop

End Sub

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Copying and pasting with a macro

Replace
Cells(x, 12).Copy Sheets("2").Cells(y, 1)
by
Sheets("2").Cells(y, 1).Value = Cells(x, 12).Value


--
Regards!
Stefi



€˛Wombat€¯ ezt Ć*rta:

Hi!

I posted this up yesterday and am very pleased with the corrections I got. I
do have another question though:

How can I make it so that the copied information is inserted into sheet 2
and takes on the format of the target cell rather than keeping the original
one?


Sub Wombat()

Sheets("1").Cells(3, 12).Select
x = 3
y = 24
Do Until Cells(x, 12).Value = "END"
If Cells(x, 12).Value < "" Then
Cells(x, 12).Copy Sheets("2").Cells(y, 1)
x = x + 1
y = y + 1
Else
x = x + 1
End If
Loop

End Sub

Thanks in advance


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
Copying & Pasting sjmonroe Excel Discussion (Misc queries) 5 November 20th 09 09:32 PM
Macro for Copying pasting between different spreadsheets Adnan Excel Discussion (Misc queries) 4 April 21st 09 03:12 PM
Macro copying and pasting James O[_2_] Excel Discussion (Misc queries) 0 April 24th 07 04:56 PM
Copying and Pasting Macro Jurassien Excel Discussion (Misc queries) 6 February 7th 07 11:57 PM
Copying and Pasting Rows Macro tnederlof Excel Discussion (Misc queries) 1 February 2nd 07 05:23 PM


All times are GMT +1. The time now is 10:57 PM.

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"