Excel Macro Help needed

mustang2010

New Member
Joined
Aug 30, 2010
Messages
8
I am trying to create a macro that selects 7 contiguous rows in the same column and then select copy then move the cursor to the next row below execute another macro for that cell and then start this first macro down the column.
I need this to work throughout the same column say Column A and have the macro work anywhere in Column A. Decription Example below:

A1 Select cell
A2 Select cell
A3 Select cell
A4 Select cell
A5 Select cell
A6 Select cell
A7 Select cell Copy the selected range of cells
A8 Move cursor here and run a paste special transpose macro already created
A9move cursor 2 rows and start original macro on next 7 rows
A10 Macro 1 start

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
What is the objective? Selecting cells is unnecessary and slows your code down. What is the code for the PasteSpecial macro?
 
Upvote 0
I have hundreds of Addresses 7 rows of data in a column separated by 2 blank rows I need to transpose to a single line of data for each address so I can clean up the format to create a proper list after this process.

the transpose code is :

Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+t
'

Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub

Thanks!
 
Upvote 0
Try this with a copy of your sheet

Code:
Sub test()
Dim LR As Long, i As Long, j As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR - 6 Step 9
    j = j + 1
    Range("B" & j).Resize(, 9).Value = Application.Transpose(Range("A" & i).Resize(9))
Next i
Columns("A").Delete
Columns("A:G").AutoFit
End Sub
 
Upvote 0
The wont work. I just need a simple command to select seven rows including the active cell copy it, move down one row run macro 2 move down one row and loop the needed macro to select 7 cells.
 
Upvote 0
Yes I did , Its not exactly what I need on each row after the address I am paste transposing the data from the seven lines above to the eighth line. I need to preserve the original data line to be sorted out after this is mastered.

Thanks!
 
Upvote 0
<title>Excel Jeanie HTML</title>Sheet1

<table style="background-color: rgb(255, 255, 255); padding-left: 2pt; padding-right: 2pt; font-family: Calibri,Arial; font-size: 11pt;" border="1" cellpadding="0" cellspacing="0"> <colgroup> <col style="width: 30px; font-weight: bold;"> <col style="width: 290px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"> <col style="width: 64px;"></colgroup> <tbody> <tr style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt; font-weight: bold;"> <td> </td> <td>A</td> <td>B</td> <td>C</td> <td>D</td> <td>E</td> <td>F</td> <td>G</td> <td>H</td> <td>I</td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">1</td> <td style="font-weight: bold;">Univest Corporation – Skippack Branch</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">2</td> <td>Phone: (610) 222-3923</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">3</td> <td>Address: 4285 Township Line Road</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">4</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Schwenksville, Montgomery Twp, Pennsylvania, 19473</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">5</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Email: mehlc@univest.net</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">6</td> <td>Contact person: Carrie Mehl</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">7</td> <td>Website:www.univest.com</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">8</td> <td style="font-weight: bold;">Univest Corporation – Skippack Branch</td> <td>Phone: (610) 222-3923</td> <td>Address: 4285 Township Line Road</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Schwenksville, Montgomery Twp, Pennsylvania, 19473</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Email: mehlc@univest.net</td> <td>Contact person: Carrie Mehl</td> <td>Website:www.univest.com</td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">9</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">10</td> <td style="font-weight: bold;">Univest Corporation – Skippack Branch</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">11</td> <td>Phone: (610) 222-3923</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">12</td> <td>Address: 4285 Township Line Road</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">13</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Schwenksville, Montgomery Twp, Pennsylvania, 19473</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">14</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Email: mehlc@univest.net</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">15</td> <td>Contact person: Carrie Mehl</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">16</td> <td style="font-weight: bold;">Website:www.univest.com</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">17</td> <td style="font-weight: bold;"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">18</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">19</td> <td style="font-weight: bold;">Univest Corporation – Skippack Branch</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">20</td> <td>Phone: (610) 222-3923</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">21</td> <td>Address: 4285 Township Line Road</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">22</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Schwenksville, Montgomery Twp, Pennsylvania, 19473</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">23</td> <td style="color: rgb(0, 0, 255); text-decoration: underline;">Email: mehlc@univest.net</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">24</td> <td>Contact person: Carrie Mehl</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 18px;"> <td style="text-align: center; background-color: rgb(202, 202, 202); font-size: 8pt;">25</td> <td style="font-weight: bold;">Website:www.univest.com</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr></tbody></table>

Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Before the macro

Excel Workbook
A
1Univest Corporation Skippack Branch
2Phone: (610) 222-3923
3Address: 4285 Township Line Road
4Schwenksville, Montgomery Twp, Pennsylvania, 19473
5Email: mehlc@univest.net
6Contact person: Carrie Mehl
7Website:www.univest.com
8
9
10Univest Corporation Skippack Branch
11Phone: (610) 222-3923
12Address: 4285 Township Line Road
13Schwenksville, Montgomery Twp, Pennsylvania, 19473
14Email: mehlc@univest.net
15Contact person: Carrie Mehl
16Website:www.univest.com
17
18
19Univest Corporation Skippack Branch
20Phone: (610) 222-3923
21Address: 4285 Township Line Road
22Schwenksville, Montgomery Twp, Pennsylvania, 19473
23Email: mehlc@univest.net
24Contact person: Carrie Mehl
25Website:www.univest.com
Sheet1




After

Excel Workbook
ABCDEFG
1Univest Corporation Skippack BranchPhone: (610) 222-3923Address: 4285 Township Line RoadSchwenksville, Montgomery Twp, Pennsylvania, 19473Email: mehlc@univest.netContact person: Carrie MehlWebsite:www.univest.com
2Univest Corporation Skippack BranchPhone: (610) 222-3923Address: 4285 Township Line RoadSchwenksville, Montgomery Twp, Pennsylvania, 19473Email: mehlc@univest.netContact person: Carrie MehlWebsite:www.univest.com
3Univest Corporation Skippack BranchPhone: (610) 222-3923Address: 4285 Township Line RoadSchwenksville, Montgomery Twp, Pennsylvania, 19473Email: mehlc@univest.netContact person: Carrie MehlWebsite:www.univest.com
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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