Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Merge an entire row

Hi Guy,

Try:

Sub Macro1()
Dim r As Long
Dim rng As Range

r = 2
Set rng = Rows(r)

rng.MergeCells = True

End Sub

---
Regards,
Norman



"Joe" wrote in message
...
Hi all
How do I use the range object (vba) to merge an entire row (lets say row
r).
TIA
Guy



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Merge an entire row

Hi Stuart,

Sub Macro2()
Dim r As Long
Dim rng As Range

r = 10

Set rng = Cells(r, 1).Resize(1, 4)

rng.MergeCells = True

End Sub


---
Regards,
Norman



"Joe" wrote in message
...
Thanks Norman.

What if I know the row (r)
And I want to merge only the first four columns
(e.g merge A10 to D10)
Again - I have the row number r.

TIA
Guy

"Norman Jones" wrote in message
...
Hi Guy,

Try:

Sub Macro1()
Dim r As Long
Dim rng As Range

r = 2
Set rng = Rows(r)

rng.MergeCells = True

End Sub

---
Regards,
Norman



"Joe" wrote in message
...
Hi all
How do I use the range object (vba) to merge an entire row (lets say row
r).
TIA
Guy







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Merge an entire row

Hi all
How do I use the range object (vba) to merge an entire row (lets say row r).
TIA
Guy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Merge an entire row

Thanks Norman.

What if I know the row (r)
And I want to merge only the first four columns
(e.g merge A10 to D10)
Again - I have the row number r.

TIA
Guy

"Norman Jones" wrote in message
...
Hi Guy,

Try:

Sub Macro1()
Dim r As Long
Dim rng As Range

r = 2
Set rng = Rows(r)

rng.MergeCells = True

End Sub

---
Regards,
Norman



"Joe" wrote in message
...
Hi all
How do I use the range object (vba) to merge an entire row (lets say row
r).
TIA
Guy





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
Zip codes in mail merge - first digit doesn't display in merge Cheryl Excel Discussion (Misc queries) 1 December 22nd 09 08:13 PM
Remove Merge and Center for entire spreadsheet JE Excel Worksheet Functions 3 April 21st 08 02:53 PM
mail merge excludes my headers and critical data in Word merge Nix Excel Discussion (Misc queries) 0 April 21st 06 08:35 PM
Merge =( formula should retain fraction type numbers after merge. Aubrey Excel Worksheet Functions 0 February 9th 06 07:37 PM
how do i get my mail merge to update the data source at each merge Steel_Monkey Excel Discussion (Misc queries) 0 November 30th 05 08:41 AM


All times are GMT +1. The time now is 11:38 PM.

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"