LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default ActiveCell.Row noncontiguous

Vergel,

I am at the tail end of a project and have posted a couple of questions,
this being one of them.
I have searched the web and read books trying to resolve this puzzle. Your
code works exactly as I had hoped for.
I know it's relative, but to me, this is genius.

Cheers mate!

"Vergel Adriano" wrote:

Steve,

Maybe something like this:

Sub test()

Dim c As Range
Dim rngCopy As Range

If TypeName(Selection) = "Range" Then
For Each c In Selection
If rngCopy Is Nothing Then
Set rngCopy = Range("K" & c.Row & ":" & "M" & c.Row)
Else
Set rngCopy = Application.Union(rngCopy, Range("K" & c.Row & ":"
& "M" & c.Row))
End If
Next c
rngCopy.Copy
End If


End Sub

--
Hope that helps.

Vergel Adriano


"Steve" wrote:

I am using the ActiveCell.Row to copy and paste cell content.

Range("K" & ActiveCell.Row & ":" & "M" & ActiveCell.Row).Copy

It allows the user to perform certain functions without being concerned
about which columns to select.
Many times they will be selecting multiple rows. Is there a modification to
this routine that allows for the
selection of multiple or noncontiguous rows?

Thanks,
Steve

 
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
I want to add more that 30 noncontiguous cells in Excel Egozite Excel Worksheet Functions 5 June 19th 08 05:34 AM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format Karthik Bhat - Bangalore[_2_] Excel Programming 1 May 9th 07 02:37 PM
Noncontiguous rows KC8DCN Excel Discussion (Misc queries) 3 August 18th 06 05:34 AM
noncontiguous cells Vivian Excel Discussion (Misc queries) 2 July 21st 06 01:00 AM


All times are GMT +1. The time now is 09:33 AM.

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

About Us

"It's about Microsoft Excel"