Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculations in VBA
I have a Named Range called "Data_Cells"
[='Sheet1'!$F$20:$L$31,'Sheet1'!$N$20:$O$31,'Sheet1 '!$O$42:$O$44)] Now I wish to divide each cell in "Data_Cells" with the value in "P15" using VBA like... For Each cell in "Data_Cells" Data_Cells.value/P15 Exit for Please help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculations in VBA
see if this will work for you
Option Explicit Dim r1 As Range Dim r2 As Range Dim cell As Range Sub test2() Set r1 = Range("data_cells") Set r2 = Range("p15") r1.Select For Each cell In Range("data_cells") cell.Value = cell.Value / r2 Next End Sub -- Gary "Murtaza" <NoEmail@NoEmail wrote in message ... I have a Named Range called "Data_Cells" [='Sheet1'!$F$20:$L$31,'Sheet1'!$N$20:$O$31,'Sheet1 '!$O$42:$O$44)] Now I wish to divide each cell in "Data_Cells" with the value in "P15" using VBA like... For Each cell in "Data_Cells" Data_Cells.value/P15 Exit for Please help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculations in VBA
Sub test()
Dim cel As Range Dim P As Double P = Sheets(1).Range("P15").Value If P = 0 Then Exit Sub For Each cel In Range("Data_cells") cel.Value = cel.Value / P Next End Sub HTH. Best wishes Harald "Murtaza" <NoEmail@NoEmail skrev i melding ... I have a Named Range called "Data_Cells" [='Sheet1'!$F$20:$L$31,'Sheet1'!$N$20:$O$31,'Sheet1 '!$O$42:$O$44)] Now I wish to divide each cell in "Data_Cells" with the value in "P15" using VBA like... For Each cell in "Data_Cells" Data_Cells.value/P15 Exit for Please help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MPG Calculations | Excel Worksheet Functions | |||
Calculations | Excel Discussion (Misc queries) | |||
Calculations | Excel Worksheet Functions | |||
Need help on some calculations.. | New Users to Excel | |||
Between calculations | Excel Worksheet Functions |