#1   Report Post  
Posted to microsoft.public.excel.programming
Nad Nad is offline
external usenet poster
 
Posts: 20
Default Macro Help

Hi,
Please help to write the Macro.
In Sheet1, i have to copy the range B2..B10
In Sheet2, i want to paste this copied this range like
C4 (Data from Sheet1/B2)
D4 (Blank)
E4 (Data from sheet1/B3)
Now,
C5 (data from Sheet1/B4)
D5 (Blank)
.......
Best Regards,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro Help

Hi Nad,

Try turning on the Macro recorder while you perform the
requisite actions manually.

The resultant code may be edited in order to optimise it
and obtain a more generic procedure.

If you experience problems with such editing, post your
code and indicate the specific problems.


---
Regards,
Norman


"Nad" wrote in message
...
Hi,
Please help to write the Macro.
In Sheet1, i have to copy the range B2..B10
In Sheet2, i want to paste this copied this range like
C4 (Data from Sheet1/B2)
D4 (Blank)
E4 (Data from sheet1/B3)
Now,
C5 (data from Sheet1/B4)
D5 (Blank)
......
Best Regards,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro Help

Record a macro when you copy each cell in B2:B10 and paste into the appropriate
cell. Keep recording while you do all 9 copy|pastes and you'll have your code.

But maybe you could use a formula instead:

In Sheet2 c4:
=sheet1!b2
or
=if(sheet1!b2="","",sheet1!b2)

Maybe you don't need the macro at all????

Nad wrote:

Hi,
Please help to write the Macro.
In Sheet1, i have to copy the range B2..B10
In Sheet2, i want to paste this copied this range like
C4 (Data from Sheet1/B2)
D4 (Blank)
E4 (Data from sheet1/B3)
Now,
C5 (data from Sheet1/B4)
D5 (Blank)
......
Best Regards,


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro Help

Does this do it for you?

Sub copystrange()
For i = 1 To 10
Sheets("sheet1").Cells(i + 1, 2).Copy _
Sheets("sheet2").Cells(4, i + 2)
Next
End Sub
--
Don Guillett
SalesAid Software

"Nad" wrote in message
...
Hi,
Please help to write the Macro.
In Sheet1, i have to copy the range B2..B10
In Sheet2, i want to paste this copied this range like
C4 (Data from Sheet1/B2)
D4 (Blank)
E4 (Data from sheet1/B3)
Now,
C5 (data from Sheet1/B4)
D5 (Blank)
......
Best Regards,



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Help

hi
how i can run macro automaticly without creating or pressing any
buttoms

best regards


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro Help

Hi Ms wafaa,

'--------------
how i can run macro automaticly without creating or
pressing any buttoms
'--------------

If the code is to be executed without direct user intervention,
you would need to use an event procedure.

It is not clear, however, when the code is to be executed or
in response to what event. Perhaps you could provide some
explanatory detail?

If you are not familiar with macros, you may wish to visit
David McRitchie's:

'Getting Started With Macros And User Defined Functions'
http://www.mvps.org/dmcritchie/excel/getstarted.htm


You might also look at David's tutorials page at:

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

For an overview of Event procedures see Chip Pearson's Events
page at:

http://www.cpearson.com/excel/events.htm

---
Regards,
Norman





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro Help

Is this part of the question here or a completely different question?

--
Don Guillett
SalesAid Software

"Ms wafaa" <Ms
wrote in message
...
hi
how i can run macro automaticly without creating or pressing any
buttoms

best regards



  #8   Report Post  
Posted to microsoft.public.excel.programming
Nad Nad is offline
external usenet poster
 
Posts: 20
Default Macro Help

Thanks Don
Your code is very close to the answer.
With litle change i got the requiried result.
Thanks once again.
Thanks others also for answering my question.
Regards
"Don Guillett" wrote:

Does this do it for you?

Sub copystrange()
For i = 1 To 10
Sheets("sheet1").Cells(i + 1, 2).Copy _
Sheets("sheet2").Cells(4, i + 2)
Next
End Sub
--
Don Guillett
SalesAid Software

"Nad" wrote in message
...
Hi,
Please help to write the Macro.
In Sheet1, i have to copy the range B2..B10
In Sheet2, i want to paste this copied this range like
C4 (Data from Sheet1/B2)
D4 (Blank)
E4 (Data from sheet1/B3)
Now,
C5 (data from Sheet1/B4)
D5 (Blank)
......
Best Regards,




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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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