Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2015, 07:21 AM
PokerBob PokerBob is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2010 64bit
Novice
***help*** macro needed
 
Join Date: Mar 2015
Posts: 5
PokerBob is on a distinguished road
Default ***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.
Reply With Quote
  #2  
Old 03-16-2015, 04:26 PM
Snakehips Snakehips is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

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
Hope that helps.
Reply With Quote
  #3  
Old 03-16-2015, 04:42 PM
PokerBob PokerBob is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2010 64bit
Novice
***help*** macro needed
 
Join Date: Mar 2015
Posts: 5
PokerBob is on a distinguished road
Default

Thanks. I tried it and nothing happens. Please let me know if I am missing anything.
Bob
Reply With Quote
  #4  
Old 03-17-2015, 03:33 AM
Snakehips Snakehips is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

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 ...
Reply With Quote
  #5  
Old 03-18-2015, 12:31 PM
PokerBob PokerBob is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2010 64bit
Novice
***help*** macro needed
 
Join Date: Mar 2015
Posts: 5
PokerBob is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 03-18-2015, 01:28 PM
Snakehips Snakehips is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

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?
Reply With Quote
  #7  
Old 03-18-2015, 01:48 PM
PokerBob PokerBob is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2010 64bit
Novice
***help*** macro needed
 
Join Date: Mar 2015
Posts: 5
PokerBob is on a distinguished road
Default

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.
Reply With Quote
  #8  
Old 03-18-2015, 02:28 PM
Snakehips Snakehips is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

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
Reply With Quote
  #9  
Old 03-18-2015, 02:57 PM
PokerBob PokerBob is offline ***help*** macro needed Windows 8 ***help*** macro needed Office 2010 64bit
Novice
***help*** macro needed
 
Join Date: Mar 2015
Posts: 5
PokerBob is on a distinguished road
Thumbs up

Thanks. Works great.
Reply With Quote
Reply

Thread Tools
Display Modes


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
***help*** macro needed repel Macro vba help is needed for interactive powerpoint. Mrs Blobby PowerPoint 1 04-16-2014 10:58 PM
***help*** macro needed 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
***help*** macro needed Callout macro needed - Help please Peter Denly Word VBA 19 07-20-2011 03:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft