![]() |
|
#1
|
|||
|
|||
|
Hello. I want to be able to select any or all of the colors in rows A1-A7 and then run my compile macro and have the selected section appear in A10-A16. This performs as expected. Now, I want to make another selection and compile without clearing A10-A16. The only way this works is if I’m selecting the same number or more colors. If I select fewer then there are still some colors left over from the previous compile. I tried to “Clear Contents” of A10-A16 in the macro before pasting the new selection but when I do this it clears my new selected selection. Thanks
|
|
#2
|
|||
|
|||
|
Code:
Sub cpypste()
Dim InputCells As Excel.Range
Dim OutputCells As Excel.Range
'Show input box to get range of cells that want to copy
Set InputCells = _
Application.InputBox(Prompt:="Select Cell / Cells To Copy", _
Title:="Copy Paste", Type:=8)
'Show input box to get where they want it paste
Set OutputCells = _
Application.InputBox(Prompt:="Select cell where you want paste", _
Title:="Copy Paste", Type:=8)
'Copy range of input cells
InputCells.Copy
'Paste it into output cells reference
OutputCells.PasteSpecial (xlPasteAll)
End Sub
|
|
#3
|
||||
|
||||
|
or:
Code:
Sub CopySelectedCells()
rw = Application.Max(10, Cells(Rows.Count, 1).End(xlUp).Row + 1)
Selection.Copy Range("A" & rw)
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Table of contents problems with arabic words | Baby_1 | Word | 0 | 07-20-2017 01:36 AM |
Clearing form
|
wpryan | Word VBA | 2 | 09-05-2015 01:06 AM |
| Word 2011 for Mac - problems with table of contents | tepose | Word | 1 | 09-28-2014 03:36 PM |
Table of Contents problems
|
lsmcal1984 | Word | 1 | 08-21-2013 11:51 AM |
Table of Contents problems
|
hassanfadil | Word | 2 | 06-02-2011 12:05 AM |