Lowell In the south
Board Regular
- Joined
- Sep 26, 2002
- Messages
- 55
Here is the code I have picked up on the board. It appears to be working to find the first blank cell in a visible range of cells. It appears to be copying the correct range which is currently merged in an effort to ensure all the text will be desplayed when a 2nd copy paste takes place to the same range. My problem is after it copies and pastes for the first time. The next time it tells me " This operation requires the Merged cells must be identicaly sized" refrencing the first paste line. I know Merged cell are BAD. But I am trying to figure out to automaticaly fill in the top area of a sheet with blocks of Text that are selected by using check boxes. The text boxes are between 2 and 6 cells long and 2 cells tall, and are to the right of the check boxes. You check the box and the cells are automaticaly copied and pasted to the first blank cell in the top range of the document. (make sence?)
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Range("AI2:AL3").Select
Selection.Copy
Dim Rg As Range
'// Filtered rg with header = A10:Z19
Set Rg = Range("A10:Z19")
'// Assumes Range is Filtered so now get the result
Set Rg = Rg.SpecialCells(xlCellTypeVisible)
Rg.SpecialCells(xlCellTypeBlanks)(1, 1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Else
Mymsg = "Not enough room on top of quotation. LRBII"
End If
End Sub
I think i am close but willing to try any thing!
_________________
The KING lives on at Graceland!
This message was edited by Lowell in the south on 2002-10-04 18:26
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Range("AI2:AL3").Select
Selection.Copy
Dim Rg As Range
'// Filtered rg with header = A10:Z19
Set Rg = Range("A10:Z19")
'// Assumes Range is Filtered so now get the result
Set Rg = Rg.SpecialCells(xlCellTypeVisible)
Rg.SpecialCells(xlCellTypeBlanks)(1, 1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Else
Mymsg = "Not enough room on top of quotation. LRBII"
End If
End Sub
I think i am close but willing to try any thing!
_________________
The KING lives on at Graceland!
This message was edited by Lowell in the south on 2002-10-04 18:26