#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 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 |
#3
|
|||
|
|||
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.
|
#4
|
||||
|
||||
Quote:
Check out the ThisWorkbook code-module and its Workbook_SheetActivate(ByVal Sh As Object), you could exclude certain sheets. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
combining cells with multiple choices | H28Sailor | Excel | 1 | 01-13-2017 11:02 PM |
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 |
Combining daily S.M.A.R.T data in a meaningfull sheet (2 problems) | Vitolio | Excel | 1 | 07-10-2013 08:58 AM |
Combining Text from Table Cells | robmorleyuk | Word | 1 | 11-01-2011 07:24 AM |