Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Managging some ranges

Hi, I want to perfor as very easy operation:
For a = 5 To ActiveSheet.Range("A1",
Range("A65535").End_(xlUp)).EntireRow.Count
Cells(a, 6) = Cells(a, 7)
Next
this is for all my worksheet, but if I want the user choose a specific
region with the mouse and the program execute the same macro but just with
the selected region, How?
I mean, if the user select the range("f7:f25") then the limits of the for
structure are 7 and 25, How to accomplish this???
TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Managging some ranges

filo666:

try,

Dim myCell As Range, rng As Range
Set myCell = Application.InputBox( _
prompt:="Select a cell", Type:=8)
For Each rng In myCell
Cells(rng.Row, 6) = Cells(rng.Row, 7)
Next rng

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"filo666" wrote:

Hi, I want to perfor as very easy operation:
For a = 5 To ActiveSheet.Range("A1",
Range("A65535").End_(xlUp)).EntireRow.Count
Cells(a, 6) = Cells(a, 7)
Next
this is for all my worksheet, but if I want the user choose a specific
region with the mouse and the program execute the same macro but just with
the selected region, How?
I mean, if the user select the range("f7:f25") then the limits of the for
structure are 7 and 25, How to accomplish this???
TIA

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
how copy formula that contains ranges so ranges do not overlap Patty Excel Worksheet Functions 1 November 20th 08 04:15 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM
2 ranges into one David Excel Programming 5 March 6th 04 02:59 AM
how to add 2 ranges kotharu[_8_] Excel Programming 2 November 10th 03 09:44 AM


All times are GMT +1. The time now is 03:29 PM.

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"