Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2022, 07:52 AM
14spar15 14spar15 is offline Problems combining selected cells Windows 7 64bit Problems combining selected cells Office 2010 64bit
Advanced Beginner
Problems combining selected cells
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default Problems combining selected cells

Hello, I want to build a paragraph from the several of the sentences in cells C2:C10 on these different sheets. If I click on say C4 and hit the copy button that sentence is added to C15. Now, I would like to select say C7, then hit the copy button again and it would go back to C15, go to the end of the string that is already there, add one space and then paste C7. I have found that if I go to C15 and push F2 it will put the cursor at the end of the string like I need but unfortunately C7 is then no longer on the clipboard. Is there a fix for this or if there is a better way to do this such as double clicking sentences to add them, that’s fine to. >> ALSO<< As I enter any sheet in this workbook I want to run the Clear C15 macro. I am using 60-70 sheets and am adding sheets daily so I hope I don’t have to do something for each sheet to achieve this. Each sheet has the same basic outline so regardless of the sheet, C15 is the cell that needs to be cleared. I don’t need to store anything in any of the C15 cells on any of the sheets after pasting it in to another application or leaving that sheet. Thanks
Attached Files
File Type: xlsm Book4.xlsm (34.7 KB, 6 views)
Reply With Quote
  #2  
Old 08-11-2022, 09:07 AM
p45cal's Avatar
p45cal p45cal is offline Problems combining selected cells Windows 10 Problems combining selected cells Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Try this for the macro:
Code:
Sub CopySelectedCells()
For Each cll In Selection.Cells
  Range("C15").Value = Range("C15").Value & " " & cll.Value
Next cll
End Sub
It will only copy text, no formatting such as bold colour etc.
Note also that it will copy the cells in the order you selected them in, even if the cells are next to each other. For example you could hold the Ctrl key down then in sequence click on C10, then C9 then C8, you'll get:
Only formulas and number formatting. The width of one column or range of columns to another column or range of columns. Cell contents and formatting except cell borders.


It's not quite perfect, it adds a space for the first cell copied too.

Last edited by p45cal; 08-12-2022 at 04:06 AM. Reason: spellin
Reply With Quote
  #3  
Old 08-11-2022, 11:21 AM
14spar15 14spar15 is offline Problems combining selected cells Windows 7 64bit Problems combining selected cells Office 2010 64bit
Advanced Beginner
Problems combining selected cells
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default

I like it....That solves the major flaw in this application and will make it much more usefull. Thanks. Is it unlikely that there is a solution to clear the content of cell C15 on entering any sheet in this workbook. I found a way to do this for individual sheets but it would require changes on each sheet and each new sheet in the future.
Reply With Quote
  #4  
Old 08-12-2022, 04:10 AM
p45cal's Avatar
p45cal p45cal is offline Problems combining selected cells Windows 10 Problems combining selected cells Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Quote:
Originally Posted by 14spar15 View Post
Is it unlikely that there is a solution to clear the content of cell C15 on entering any sheet in this workbook. I found a way to do this for individual sheets but it would require changes on each sheet and each new sheet in the future.
How did you do it?
Check out the ThisWorkbook code-module and its Workbook_SheetActivate(ByVal Sh As Object), you could exclude certain sheets.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems combining selected cells combining cells with multiple choices H28Sailor Excel 1 01-13-2017 11:02 PM
Problems combining selected cells Combining several cells data into one single cell H28Sailor Excel 6 01-09-2017 06:00 AM
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells CodingGuruInTraining Word VBA 24 10-07-2015 07:48 PM
Problems combining selected cells Combining daily S.M.A.R.T data in a meaningfull sheet (2 problems) Vitolio Excel 1 07-10-2013 08:58 AM
Problems combining selected cells Combining Text from Table Cells robmorleyuk Word 1 11-01-2011 07:24 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:53 AM.


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