#1
|
|||
|
|||
***help*** macro needed
Hi,
I need a macro that will mover a col. of data to a single row. Example: 1 2 3 4 5 6 7 8 9 to 1 2 3 4 5 6 7 8 9 But, not for the hole worksheet, just the data group that I select. Many thanks Last edited by PokerBob; 03-14-2015 at 02:54 PM. |
#2
|
|||
|
|||
PokerBob,
Try the below.... Code:
Sub Selection_Col2Row() With Selection If .Rows.Count < 2 Then Exit Sub If .Columns.Count > 1 Then Exit Sub Set Rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) End With With Rng Rng.Copy .Cells(1, 1).Offset(-1, 1).Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True .ClearContents .Cells(1, 1).Offset(-1, 0).Select Application.CutCopyMode = False End With End Sub |
#3
|
|||
|
|||
Thanks. I tried it and nothing happens. Please let me know if I am missing anything.
Bob |
#4
|
|||
|
|||
I assume that you have pasted the code into the vb editor, either in a sheet module or a code module ? Perhaps better in a code module.
Then with your column range selected - run the macro by whatever means you wish or have set up, e.g. shortcut , button, Macro Run, direct from the vb editor ... |
#5
|
|||
|
|||
Here is another request. I have list (column) of email addresses that are like this.
"Email: example@aol.aom" I need a macro that would delete the word Email: and the space between the word and the email address. Thank you in advance. |
#6
|
|||
|
|||
Firstly, what is the feedback on your original request?
Re the Email addresses. Is it just removing 'Email: ' from the front end of all ? Why do you need macro rather than use formulas? |
#7
|
|||
|
|||
Sorry, I did reply to my first thread. You macro did worked. I guess it did not get posted. Thanks again.
RE: Email... yes it is just to remove the word email: from the front along with the space. As for formulas, I do not know them. |
#8
|
|||
|
|||
For example.......
Assuming your original text is in column A starting row 2.... In B2 type the formula. =RIGHT(A2,LEN(A2)-7) And then drag it down as far as you need. If you then need to convert the results to 'hard ' values........ Copy the column B and Paste Special. >>>. Values |
#9
|
|||
|
|||
Thanks. Works great.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro Needed to bold specific lines and Macro to turn into CSV | anewteacher | Word VBA | 1 | 05-28-2014 03:59 PM |
repel Macro vba help is needed for interactive powerpoint. | Mrs Blobby | PowerPoint | 1 | 04-16-2014 10:58 PM |
I need help with macro...code needed for automatic sorting | chefmate | Excel Programming | 1 | 08-26-2012 01:04 AM |
Check box macro help needed | Aflac | Word | 4 | 03-24-2012 07:11 PM |
Callout macro needed - Help please | Peter Denly | Word VBA | 19 | 07-20-2011 03:30 AM |