Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default passing a cells content into a macro


Cano1963 wrote:
I sent you an email just now.

"meatshield" wrote:


Cano1963 wrote:
how do i send it to you? can i do attachments?


"meatshield" wrote:


Cano1963 wrote:
Here is my program it simple except for the fact of needing too many arguments.

basically what I does is look to see if certain equipment is there if it is
there it checks to see if it is new or refurb, then it get the cost of
equipment and then it check for the accessories then it adds the cost of the
accessory to the equipment cost. next, it check for other accessories until
the last one and output cost of equipment to my work sheet. There are 4
types of equipment with 2 cost for each. then there are three types of
accessories with 2 different costs for each. So you can see that it is easy
but the arguments are too many to pass. ]

sorry ahead for the sloppy programinig and english. i have been looking over
net for days and trying different way to do this that i find that might help.

Function equipmentcost(eqname As String, eqtype1 As String, eqtype2 As
String, eqtype3 As String, eqtype4 As String, eqtype5 As String, eqtype6 As
String, eqtype7 As String, eqamount1 As Integer)
If eqname = "" Then
equipmentcost = 0 ' this is if there is an empty eqname has no equipment
cost cause there is no equipment
Else
Select Case eqname
Case Is = "8000 GPRS:"
'checking if new or refurbed
If eqtype1 = "refurb" Then
' equipmentcost = Active.worksheet3(58, 3) attempt
'checking for other equipment
'checking for pp1000 equipment
'Ifr Active.Worksheet(6, 7) = "refurb" Then
'Cells(1,1).Select' Will select the cell at A1
If ActiveCell.Address(6, 7) = "refurb" Then '
equipmentcost = Active.worksheet3(3, 58) +
Active.worksheet3(3, 66)
ElseIf Active.worksheet1!(6, 7) = "new" Then
equipmentcost = Active.worksheet3(58, 3) +
Active.worksheet3(67, 3)
Else
equipmentcost = Active.worksheet3(58, 3)
End If 'done checking for pp1000
'checking for magteck reader equipment
If Active.worksheet1(12, 7) = "refurb" Then
equipmentcost = equipmentcost + Active.worksheet3(72, 3)
ElseIf Active.worksheet1(12, 7) = "new" Then
equipmentcost = equipmentcost + Active.worksheet3(73, 3)
Else
equipmentcost = equipmentcost
End If 'done checking for magteck reader
'checking for vivo equipment
If Active.worksheet1(15, 7) = "refurb" Then
equipmentcost = equipmentcost + Active.worksheet3(76, 3)
ElseIf Active.worksheet1(15, 7) = "new" Then
equipmentcost = equipmentcost + Active.worksheet3(77, 3)
Else
equipmentcost = equipmentcost
End If 'done checking for vivo
'done checking for all equipment
Else
equipmentcost = Active.worksheet3(59, 3)
'checking for other equipment
'checking for pp1000 equipment
If Active.worksheet1(6, 7) = "refurb" Then
equipmentcost = equipmentcost + Active.worksheet3(66, 3)
ElseIf Active.worksheet1(6, 7) = "new" Then
equipmentcost = equipmentcost + Active.worksheet3(67, 3)
Else
equipmentcost = equipmentcost
End If 'done checking for pp1000
'checking for magteck reader equipment
If Active.worksheet1(12, 7) = "refurb" Then
equipmentcost = equipmentcost + Active.worksheet3(72, 3)
ElseIf Active.worksheet1(12, 7) = "new" Then
equipmentcost = equipmentcost + Active.worksheet3(73, 3)
Else
equipmentcost = equipmentcost
End If 'done checking for magteck reader
'checking for vivo equipment
If Active.worksheet1(15, 7) = "refurb" Then
equipmentcost = equipmentcost + Active.worksheet3(76, 3)
ElseIf Active.worksheet1(15, 7) = "new" Then
equipmentcost = equipmentcost + Active.worksheet3(77, 3)
Else
equipmentcost = equipmentcost
End If 'done checking for vivo
'done checking for all equipment
End If
Case Is = "Omni 3750"
If (eqtype2 = refurb) Then
equipmentcost = Active.worksheet3(60, 3)

Else
equipmentcost = Active.worksheet3(61, 3)

End If
Case Is = "Omni 3740"
If (eqtype2 = refurb) Then
equipmentcost = Active.worksheet3(62, 3)
Else
equipmentcost = Active.worksheet3(63, 3)
End If
Case Is = "Omni 3730"
If (eqtype2 = refurb) Then
equipmentcost = Active.worksheet3(64, 3)
Else
equipmentcost = Active.worksheet3(65, 3)
End If

Case Else
'equipmentcost = "1000.00"
equipmentcost = Range("A58").Select ' will jump to that
particular cell
End Select
End If
End Function


"Cano1963" wrote:

I have a problem. I need to pass the contents of a cell int to a macro. I
dont want to use it in the arguments of the macro cause i would have to pass
20 argument.
what i want to see if there is a way to use something like
(example but this doesnt work
If ActiveCell.Address(6, 7) = "refurb" Then
equipmentcost = Active.worksheet3(3, 58) +
Active.worksheet3!(3, 66))
notice i try and and use Activecell.address(r,c) or active.worksheet3!(r,c)

i want to use these type statment to pass the argument. not

Function equipmentcost(eqname As String, eqtype1 As String, eqtype2 As
String, eqtype3 As String, eqtype4 As String, eqtype5 As String, eqtype6 As
String, eqtype7 As String, eqamount1 As Integer)

i dont want to put 20 or 30 that many items in there. please help cause i
am stuck.

if you guys have a differnet way to approach this please tell me.

thanks

I hope my english is ok so sorry if it is not.
Is there any way you could send me a sample of workbook? I think I
have an idea of what you are trying to do, but I am not sure how
everything is laid out.


You can email me a komeat[ignorethis]shield [at] yahoo.com
You can also get my email address by clicking on my profile.


Hmm, I haven't gotten it yet.. Did you send it to
?

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
Macro help: moving specific cells based upon content Scheetsky Excel Worksheet Functions 7 September 4th 09 02:59 PM
passing a cells content into a macro [email protected] Excel Programming 0 January 10th 07 09:39 PM
Macro to highlight cells based on content JimDerDog Excel Worksheet Functions 1 February 1st 06 03:51 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
macro - hiding rows given a cells content Greg Stevens Excel Programming 3 October 15th 04 09:25 PM


All times are GMT +1. The time now is 08:13 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"