PC Review


Reply
Thread Tools Rate Thread

Cannot select rows in VBA

 
 
bjdesa@cyber.net.pk
Guest
Posts: n/a
 
      6th Sep 2007
I am trying to find a way to select rows via VBA using the macro below
but when Rows("6:11").Select is executed it selects rows 3 to 18. Does
someone know how I could select the row 6 to 11 via VBA.

Sub Macro1()
'
' Macro1 Macro
'

'
Range("B3:B18").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Rows("6:11").Select
End Sub

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      6th Sep 2007
Merged cells behave weirdly.

Can you eliminate the merged cells?

(E-Mail Removed) wrote:
>
> I am trying to find a way to select rows via VBA using the macro below
> but when Rows("6:11").Select is executed it selects rows 3 to 18. Does
> someone know how I could select the row 6 to 11 via VBA.
>
> Sub Macro1()
> '
> ' Macro1 Macro
> '
>
> '
> Range("B3:B18").Select
> With Selection
> .HorizontalAlignment = xlCenter
> .VerticalAlignment = xlBottom
> .WrapText = False
> .Orientation = 0
> .AddIndent = False
> .IndentLevel = 0
> .ShrinkToFit = False
> .ReadingOrder = xlContext
> .MergeCells = False
> End With
> Selection.Merge
> Rows("6:11").Select
> End Sub


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i randomly select 780 rows from 4000 rows of data =?Utf-8?B?YmJi?= Microsoft Excel Worksheet Functions 2 6th Jul 2007 08:21 PM
Select i Rows daniroy@gmail.com Microsoft Excel Programming 3 1st Feb 2007 03:25 PM
Macro to select 4 entire rows and then delete rows Scott Viney Microsoft Excel Discussion 3 22nd Sep 2005 07:02 PM
select block of rows w/data between blank rows =?Utf-8?B?SmFubmE=?= Microsoft Excel Programming 6 13th Feb 2005 02:45 AM
Unable to select rows in the repeat rows on top option =?Utf-8?B?Tm9wcGll?= Microsoft Excel Misc 2 28th Dec 2004 03:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:52 AM.