MACRO to copy / paste cell text down various rows
Solved/Closed
debtiger99
Posts
4
Registration date
Wednesday August 1, 2018
Status
Member
Last seen
August 10, 2018
-
Aug 1, 2018 at 03:54 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Aug 14, 2018 at 11:26 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Aug 14, 2018 at 11:26 AM
Related:
- MACRO to copy / paste cell text down various rows
- Spell number in excel without macro - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Run macro when cell value changes by formula ✓ - Excel Forum
- Count if cell contains number - Excel Forum
- This message was deleted text copy and paste - Android Forum
4 responses
Click on the Name column, and SORT by ALPHA! No need for a macro. If it says that there is other data not selected, say YES select that data too! If you say no, the name only will be moved, and the the rest of the columns will not be sorted with the original record!
SIMPLE!
SIMPLE!
debtiger99
Posts
4
Registration date
Wednesday August 1, 2018
Status
Member
Last seen
August 10, 2018
Aug 2, 2018 at 07:27 AM
Aug 2, 2018 at 07:27 AM
Thanks for the response but unfortunately it does not produce the result I need. Also, the format of my original note did not stay the same when I hit enter. Imagine this: Column A has the company names, Column B the employee's last names. Only the first employee in the list of 15 people indicates the name of the company and the remaining employees have a blank cell for their company name because it is easy to see who they work for since they're all together. My problem is that my list has over 50 companies and I would like to have an alphabetized list of all employees based on last name. If I sort the list as is - I have tons of people with no company name and I don't know who they work for. I need to be able to copy down the company names throughout my list so when I sort it by last name each individual has their company listed. Does this make more sense?
debtiger99
Posts
4
Registration date
Wednesday August 1, 2018
Status
Member
Last seen
August 10, 2018
Aug 2, 2018 at 07:36 AM
Aug 2, 2018 at 07:36 AM
The process that I am using currently is this:
Double click the little black cross in the bottom right corner and the company name copies down to the next company name. So I am repeatedly doing this:
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
over and over and over....
I tried to create a macro but however the macro mimics the EXACT number of rows that were copied down instead of stopping when it reaches the next cell with text.
Thank you for taking the time to assist me!
Double click the little black cross in the bottom right corner and the company name copies down to the next company name. So I am repeatedly doing this:
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
[END] [Down Arrow] [Double click copy cross]
over and over and over....
I tried to create a macro but however the macro mimics the EXACT number of rows that were copied down instead of stopping when it reaches the next cell with text.
Thank you for taking the time to assist me!
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Updated on Aug 2, 2018 at 11:16 AM
Updated on Aug 2, 2018 at 11:16 AM
Hi Debtiger,
Consider using this macro to do the task for you:
Best regards,
Trowa
Consider using this macro to do the task for you:
Sub RunMe() Dim x, lRow As Long lRow = Range("B1").End(xlDown).Row For x = 2 To lRow If Cells(x, 1) <> vbNullString Then Cells(x, 1).Copy Else Cells(x, 1).PasteSpecial End If Next x Application.CutCopyMode = False End Sub
Best regards,
Trowa
debtiger99
Posts
4
Registration date
Wednesday August 1, 2018
Status
Member
Last seen
August 10, 2018
Aug 10, 2018 at 02:12 PM
Aug 10, 2018 at 02:12 PM
TrowaD ~
I can't BEGIN to express how GRATEFUL I am to YOU!!!!!!!!!!!!!!!!!!!!!!!!!! Your VBA Code worked absolutely perfectly. I am blown away! I'm good with excel but not with code - and with the help of an online tutorial I was able to put your code to work. I have never posted an issue before and wasn't quite sure what to expect, but for a complete stranger to take the time to read all the details of my problem and spend their own time to work on a solution.... is a true indicator of the generous human spirit.
Thank you ever so much for your time and assistance.
I hope you have the most splendid day.
(insert the HAPPIEST emoticon here!)
Debra
I can't BEGIN to express how GRATEFUL I am to YOU!!!!!!!!!!!!!!!!!!!!!!!!!! Your VBA Code worked absolutely perfectly. I am blown away! I'm good with excel but not with code - and with the help of an online tutorial I was able to put your code to work. I have never posted an issue before and wasn't quite sure what to expect, but for a complete stranger to take the time to read all the details of my problem and spend their own time to work on a solution.... is a true indicator of the generous human spirit.
Thank you ever so much for your time and assistance.
I hope you have the most splendid day.
(insert the HAPPIEST emoticon here!)
Debra
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Aug 14, 2018 at 11:26 AM
Aug 14, 2018 at 11:26 AM
Thanks Debra. Your comment makes it all worthwhile!