Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Loop Through Highlighted Range

am trying to write something that will allow me to select a range of cells
(mostly just within 1 column, but maybe hundreds of rows deep). Then I want
to loop through each cell in the selection and at each cell perform
"ActiveCell.FormulaR1C1 = ActiveCell.ValueI " to basically activate the cell.
I do this for fields of info pulled from a Financial LAN where they come
down as text. Use to have this written in personal macro file, but hard
drive crashed and dont remember how I wrote it years ago.

Any help would be appreciated. Here is my non working attempt...

Sub Activate()

' Keyboard Shortcut: Ctrl+Shift+Z

Dim cell As Range
Dim myrange As Range

Range(ActiveSheet.Range).Name = "myrange"

For Each cell In Range("myrange")

ActiveCell.FormulaR1C1 = ActiveCell.Value
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
Next cell

Selection.End(xlUp).Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Loop Through Highlighted Range

Hi
try using

with selection
..value=.value
end with

--
Regards
Frank Kabel
Frankfurt, Germany

ChrisR wrote:
am trying to write something that will allow me to select a range of
cells (mostly just within 1 column, but maybe hundreds of rows deep).
Then I want to loop through each cell in the selection and at each
cell perform "ActiveCell.FormulaR1C1 = ActiveCell.ValueI " to
basically activate the cell. I do this for fields of info pulled from
a Financial LAN where they come down as text. Use to have this
written in personal macro file, but hard drive crashed and dont
remember how I wrote it years ago.

Any help would be appreciated. Here is my non working attempt...

Sub Activate()

' Keyboard Shortcut: Ctrl+Shift+Z

Dim cell As Range
Dim myrange As Range

Range(ActiveSheet.Range).Name = "myrange"

For Each cell In Range("myrange")

ActiveCell.FormulaR1C1 = ActiveCell.Value
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
Next cell

Selection.End(xlUp).Select
End Sub



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
deselecting a highlighted range after a VBA copy procedure Paul James[_3_] Excel Programming 6 April 25th 23 03:47 AM
Shading on highlighted range of cells TippieToe Excel Discussion (Misc queries) 0 April 20th 10 11:54 PM
How do I change background color of highlighted Excel range ? Jim Excel Discussion (Misc queries) 0 June 6th 08 07:59 PM
autosum refusal to sum highlighted range lawrence Excel Worksheet Functions 4 April 30th 08 10:08 PM
Range from highlighted area noyb[_2_] Excel Programming 3 February 9th 04 05:48 PM


All times are GMT +1. The time now is 03:30 AM.

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"