Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help
hi
how i can run macro automaticly without creating or pressing any buttoms best regards |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |