HELP:MACRO FOR PASTING MANY COLUMNS DATA TO 2 COLUMNS ONLY WITH blank space AFTER EVERY PASTE

sara2009

New Member
Joined
Apr 1, 2013
Messages
16
please help me i am preparing sales invoices to import, i have vast amount of data to organise.... i am rilllyy desperate for this macro:
my data is in sheet 2 from column C to Column DG, headings(eg SUYE) are in row 2,then numbers start from row 3 to row 30.
i need a macro to paste this data to sheet 1 IN COLUMN M if the heading fits the data. after every paste, there shud be one 1 blank space. numbers under SUYE shud all be pasted in sheet1 from M2 to M29 then 'SUYE' shud be pasted from N2 to N29,(M30 and N30)leave blank, then paste data under ARUSHA in M30 to M58 then M51 left blank, ARUSHA shud appear in N30 TO N58 and leave N51 blank ETC..

col C D E F
SUYE
ARUSHA
AZIMIO
BARAA
79
47
62
92
3
2
2
3
81
58
74
114
3
2
2
3
70
52
86
113
2
2
3
3
20
12
16
23
1
1
1
1
17
12
19
21
1
1
1
1
18
13
22
29
1
1
1
1
27
20
25
38
1
1
1
1
23
16
26
28
1
1
1
1
23
17
14
23
1
1
1
1
25
19
15
35
1
1
1
1
81
58
74
114
3
2
2
3
67
51
41
68
2
2
2
2
25
19
15
35
1
1
1
1
75
56
45
105
2
2
2
3

<TBODY>
</TBODY>


So it apears like this
Col M col N
79
SUYE
3
SUYE
81
SUYE
3
SUYE
70
SUYE
2
SUYE
20
SUYE
1
SUYE
17
SUYE
1
SUYE
18
SUYE
1
SUYE
27
SUYE
1
SUYE
23
SUYE
1
SUYE
23
SUYE
1
SUYE
25
SUYE
1
SUYE
81
SUYE
3
SUYE
67
SUYE
2
SUYE
25
SUYE
1
SUYE
75
SUYE
2
SUYE

<TBODY>
</TBODY>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try this....

Code:
Sub colconvert()

Dim rw As Long
Dim cl As Long
Dim NewRW As Long

NewRW = 1
For cl = 3 To 6
    For rw = 2 To 29
        Sheets("Sheet1").Cells(NewRW, "M").Value = Sheets("Sheet2").Cells(rw, cl).Value
        Sheets("Sheet1").Cells(NewRW, "N").Value = Sheets("Sheet2").Cells(1, cl).Value
        NewRW = NewRW + 1
    Next rw
    NewRW = NewRW + 1
Next cl

End Sub
 
Upvote 0
it WORKEDDDD!!!! THANK YOU SOMUCHHH rjwebgraphix!!,,,i reallly really appreciate all ur help...thanks!!!!! life is sooo easy with macros!




Try this....

Code:
Sub colconvert()

Dim rw As Long
Dim cl As Long
Dim NewRW As Long

NewRW = 1
For cl = 3 To 6
    For rw = 2 To 29
        Sheets("Sheet1").Cells(NewRW, "M").Value = Sheets("Sheet2").Cells(rw, cl).Value
        Sheets("Sheet1").Cells(NewRW, "N").Value = Sheets("Sheet2").Cells(1, cl).Value
        NewRW = NewRW + 1
    Next rw
    NewRW = NewRW + 1
Next cl

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,903
Members
449,477
Latest member
panjongshing

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top