Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,comp.lang.basic.visual.misc
|
|||
|
|||
A few Question Concerning VBA in Excel
In the following the "Macro1" does not work while "Macro1_1" does. I
know I got a method to make Range("VarName") update while being a parameter in a subroutine. But could you explain to me why and if I have done it correctly. Option Explicit Sub SaveData(A1, A2, A3) A1 = 9 A2 = 8 A3 = 7 End Sub Sub macro1() Range("name1") = "'" Range("name2") = "" Range("name3") = "" Call SaveData(Range("name1"), Range("name2"), Range("name3")) End Sub '--- BOTTOM ONES WORK THE TOP ONES DON'T Sub SaveData_1(A1 As Range, A2 As Range, A3 As Range) A1 = 9 A2 = 8 A3 = 7 End Sub Sub macro1_1() Range("name1") = "'" Range("name2") = "" Range("name3") = "" Call SaveData_1(Range("name1"), Range("name2"), Range("name3")) End Sub [Second question I have a code example] Dim Zero As Range Sub Save_Unit_Qunatities(A1 As Range, A2 As Range, A3 As Range, A4 As Range, A5 As Range, A6 As Range, A7 As Range) Set Zero = Range("Zero") 'Zero is a reference variable that is 0 [Is there a way I could assign a range variable such a Zero like this Zero = 0 ] Call Save_Unit_Qunatities(Range("PressDocking1A_Suit_Do cking_Qty_V"), Range("PressDocking1A_Rover_Docking_Qty_V"), Range("PressDocking1A_Vehicle_Docking_Qty_V"), Zero, Zero, Zero, Zero) [I have to use Zero because the problem is I can't do the following: ] Call Save_Unit_Qunatities(Range("PressDocking1A_Suit_Do cking_Qty_V"), Range("PressDocking1A_Rover_Docking_Qty_V"), Range("PressDocking1A_Vehicle_Docking_Qty_V"), 0#, 0#, 0#, 0#) [And final question when I make this call] Call Save_Unit_Qunatities(Range("PressDocking1A_Suit_Do cking_Qty_V"), Range("PressDocking1A_Rover_Docking_Qty_V"), Range("PressDocking1A_Vehicle_Docking_Qty_V"), Zero, Zero, Zero, Zero) The reference cell "PressDocking1A_Suit_Docking_Qty_V" takes on numbers but there "numbers stored as text." I there a way I can save them as numbers? I would really appreciate any help in this matter, Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions | |||
Excel question | Excel Discussion (Misc queries) | |||
Statistical Excel Function Question within Excel 2000... | Excel Worksheet Functions |