Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
deselecting a highlighted range after a VBA copy procedure | Excel Programming | |||
Shading on highlighted range of cells | Excel Discussion (Misc queries) | |||
How do I change background color of highlighted Excel range ? | Excel Discussion (Misc queries) | |||
autosum refusal to sum highlighted range | Excel Worksheet Functions | |||
Range from highlighted area | Excel Programming |