View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default Insert 2 formatted rows at cursor location

Gentlemen:
Thanks so much.
You're both correct in that I likely should use a "copy" of existing row(s).
However, due to the frequency of use, over quite a number of wb's, I find it
convenient to attach this type of procedure to an icon on one of my custom
toolbars.
It gives me flexibility in use. If a change is required, I change ONE
location and then access that change, when required, by clicking on my icon.
Yes, I know that I can set up a "master" sheet with the formatted rows and
copy from there by a click of the icon (now that you've shown me the insert
steps).
However, this best follows current practice AND lets me learn some more new
things.
What I'm trying to accomplish:

'new row 1 ' cell A insert "^^"
' Cell B Insert "x"
' Row Height = 19.5

' New Row 2 ' cell A insert "^^"
' Cell B Insert "x"
' Row Height = 6.0
' Columns B thru G
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
End With

Thanks for your support and help.
I see both of you frequently as I browse thru the newsgroups.
I hope you ( and all the other able participants ) enjoy this as much as the
"receivers" benefit and learn from it.

"Mike H" wrote:

I think your right I should have realised it was formats copied from
exisiting rows

"JLGWhiz" wrote:

Hi Mike, it should be simple enough to copy two rows that are formatted and
then use your code to insert them.

myFormattedRows.Copy
myDestinationRange.Activate
ActiveCell.Resize(2).EntireRow.Insert Shift:=xlDown
ActiveCell.Resize(2).EntireRow.Select

"Mike H" wrote:

It would help had I posted the code

ActiveCell.Resize(2).EntireRow.Insert Shift:=xlDown
ActiveCell.Resize(2).EntireRow.Select

Mike

"Mike H" wrote:

Hi,

This will insert 2 rows at the selected cell and leave the 2 new rows
selected. I don't understand what formatting your trying to apply.

Mike

"BEEJAY" wrote:

It must be Friday. Drawing blank!?

Trying to set up code so that where-ever my cursor is positioned, I can
insert 2 formatted rows. Since the rows can be required "anywhere", the
formatting needs to reflect the row positioning of the new lines.

If someone would kindly help me get started...................

What I have now is:

Rows("65522:65523").Select
Selection.Insert Shift:=xlDown

Range("A65522").Select
ActiveCell.FormulaR1C1 = "^^"
Range("A65523").Select
ActiveCell.FormulaR1C1 = "^^"
etc..............................