ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Managging some ranges (https://www.excelbanter.com/excel-programming/348572-managging-some-ranges.html)

filo666

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


chijanzen

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



All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com