LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc,comp.lang.basic.visual.misc
external usenet poster
 
Posts: 11
Default 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,

 
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
Excel Question dbvand via OfficeKB.com Excel Discussion (Misc queries) 1 September 26th 07 01:20 AM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
Excel question Eddie Excel Discussion (Misc queries) 1 March 24th 05 06:31 PM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"