Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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: 962
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
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
  #2  
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
Competent Performer
Problems combining selected cells
 
Join Date: Mar 2011
Posts: 100
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
  #3  
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: 962
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
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



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 09:26 AM.


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