Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Copy Paste Merged Cell Format

My Code:
It Bombs after running Line 6;

Public Sub CellFormat()
Application.ScreenUpdating = False
r = ActiveCell.Row
Worksheets("CellFormat") _
.Range("C1:N1").EntireRow.Copy
Worksheets("Sheet1").Activate
Rows("r:r").Select <<< Bombs Here with R/T error 1004.. Why?
ActiveSheet.Paste
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Copy Paste Merged Cell Format

Hi
what row should R:R be??
This has either be a column or change the reference to a row reference.

Note: In most cases no need for select(activate statements at all

"Jim May" wrote:

My Code:
It Bombs after running Line 6;

Public Sub CellFormat()
Application.ScreenUpdating = False
r = ActiveCell.Row
Worksheets("CellFormat") _
.Range("C1:N1").EntireRow.Copy
Worksheets("Sheet1").Activate
Rows("r:r").Select <<< Bombs Here with R/T error 1004.. Why?
ActiveSheet.Paste
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Copy Paste Merged Cell Format


Let's say I'm in Cell C4 on Sheet1 when I run the code.
r = Activecell.row ' r = 4

where later I'm trying to select
rows("4:4").select ' using rows("r:r")


Jim May

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy Paste Merged Cell Format

r = 4
Rows(r).Select

--
Regards,
Tom Ogilvy

"Jim May" wrote in message
...

Let's say I'm in Cell C4 on Sheet1 when I run the code.
r = Activecell.row ' r = 4

where later I'm trying to select
rows("4:4").select ' using rows("r:r")


Jim May

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Copy Paste Merged Cell Format

Hope this helps.

<<< you were trying to put a variable in a sring when u
put it in quotes


Application.ScreenUpdating = False
r = ActiveCell.Row
Worksheets("CellFormat") _
.Range("C1:N1").EntireRow.Copy
Worksheets("Sheet1").Activate
Rows(r).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Application.ScreenUpdating = True
-----Original Message-----
My Code:
It Bombs after running Line 6;

Public Sub CellFormat()
Application.ScreenUpdating = False
r = ActiveCell.Row
Worksheets("CellFormat") _
.Range("C1:N1").EntireRow.Copy
Worksheets("Sheet1").Activate
Rows("r:r").Select <<< Bombs Here with R/T error

1004.. Why?
ActiveSheet.Paste
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Copy Paste Merged Cell Format

Thanks Tom;
Incidentally, last week I was on Google searching for something and easily
enough came across a thread you were involved with in 2003 - where out of
the blue you made the comment "i'm your huckleberry" <<< which immediately
brought a smile to my face being a fan "of a sort" of the legend - Doc
Holliday. I've seen 4 or 5 versions of "Gunfight at the OK Corral" - and
one of the best lines in Tombstone is Val Kilmer saying it to Johnny Ringo;
Only wish in Wyatt Earp they had written it in the script for Dennis Quaid
to have said it.

You probably know "that there is only one thing better than a western,," and
that is "another western!!" - Of course to me Lonesome Dove is the "highest
calling" of all westerns...

Thank you for your contribution to the various Excel NG's - you are much
appreciated.
Jim May
Roanoke

http://www.dochollidaysociety.org/



"Tom Ogilvy" wrote in message
...
r = 4
Rows(r).Select

--
Regards,
Tom Ogilvy

"Jim May" wrote in message
...

Let's say I'm in Cell C4 on Sheet1 when I run the code.
r = Activecell.row ' r = 4

where later I'm trying to select
rows("4:4").select ' using rows("r:r")


Jim May

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy Paste Merged Cell Format

That was Val Kilmer's line for sure.
True, nothing like a good western. Too bad they are so few and far in
between these days <g

--
Regards,
Tom Ogilvy

"Jim May" wrote in message
news:vzIkd.2255$_q1.1559@lakeread08...
Thanks Tom;
Incidentally, last week I was on Google searching for something and easily
enough came across a thread you were involved with in 2003 - where out of
the blue you made the comment "i'm your huckleberry" <<< which

immediately
brought a smile to my face being a fan "of a sort" of the legend - Doc
Holliday. I've seen 4 or 5 versions of "Gunfight at the OK Corral" - and
one of the best lines in Tombstone is Val Kilmer saying it to Johnny

Ringo;
Only wish in Wyatt Earp they had written it in the script for Dennis Quaid
to have said it.

You probably know "that there is only one thing better than a western,,"

and
that is "another western!!" - Of course to me Lonesome Dove is the

"highest
calling" of all westerns...

Thank you for your contribution to the various Excel NG's - you are much
appreciated.
Jim May
Roanoke

http://www.dochollidaysociety.org/



"Tom Ogilvy" wrote in message
...
r = 4
Rows(r).Select

--
Regards,
Tom Ogilvy

"Jim May" wrote in message
...

Let's say I'm in Cell C4 on Sheet1 when I run the code.
r = Activecell.row ' r = 4

where later I'm trying to select
rows("4:4").select ' using rows("r:r")


Jim May

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Copy paste non merged to merged cells [email protected] Excel Worksheet Functions 1 February 5th 09 05:25 PM
Copy/Paste into merged cells NicoleS Excel Discussion (Misc queries) 2 December 29th 08 11:48 PM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
How do I copy data in single cell format to a merged cell format Paul Excel Discussion (Misc queries) 1 June 27th 05 11:00 AM


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"