Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Unable to view variable

I'm unable to get the value stored in the variable. I'm not sure what I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Unable to view variable

I placed value of 10 in cell L18 and your variable returned 10. So begs the
question, have you got a value 0 in cell L18 in specified worksheet?
--
jb


"KevinM" wrote:

I'm unable to get the value stored in the variable. I'm not sure what I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Unable to view variable

You may have more than one workbook opened. See if this helps

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
with Thisworkbook
paycode12 = .Worksheets("flx00012.tmp").Cells(18, "L").Value
end with
MsgBox (paycode12)


End Sub


"KevinM" wrote:

I'm unable to get the value stored in the variable. I'm not sure what I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Unable to view variable

Thanks Joel. I still get a zero value. Let me back up a bit. Here is the
code I'm using that's using variable "paycode12". I get no error when I run
it but its not giving me the value stored in these variables. If you can
assist me on getting the value out of these variables. I really appreciate
the help. Thanks in advance.


Sub retropay2()

Dim paycode12 As Long
Dim paycode13 As Integer
Dim paycode1E As Integer
Dim paycode1H As Integer
Dim paycode1I As Integer
Dim paycode1J As Integer
Dim paycode1 As Integer
Worksheets("flx00012.tmp").Activate
finalrow1 = Cells(65536, 6).End(xlUp).Row
For j = 1 To finalrow1

'this will see if j,6 is equal to paycode 1,12,13
Select Case Cells(j, 6).Value
Case 1
paycode1=Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)
Case 12
paycode12 = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

Case 13
paycode13 = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

'this will look at paycode 1E 1H in j,6
Case "1E"
paycode1E = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)
Case "1H"
payrcode1H = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

End Select
Next j
End Sub




"Joel" wrote in message
...
You may have more than one workbook opened. See if this helps

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
with Thisworkbook
paycode12 = .Worksheets("flx00012.tmp").Cells(18, "L").Value
end with
MsgBox (paycode12)


End Sub


"KevinM" wrote:

I'm unable to get the value stored in the variable. I'm not sure what
I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Unable to view variable

Yes, the value is greater than zero. Thank you.
"john" wrote in message
...
I placed value of 10 in cell L18 and your variable returned 10. So begs the
question, have you got a value 0 in cell L18 in specified worksheet?
--
jb


"KevinM" wrote:

I'm unable to get the value stored in the variable. I'm not sure what
I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Unable to view variable

These changes should work

Sub retropay2()

Dim paycode12 As Long
Dim paycode13 As Integer
Dim paycode1E As Integer
Dim paycode1H As Integer
Dim paycode1I As Integer
Dim paycode1J As Integer
Dim paycode1 As Integer
Dim finalrow1 As Long
With Worksheets("flx00012.tmp")
finalrow1 = .Cells(65536, 6).End(xlUp).Row
For j = 1 To finalrow1

'this will see if j,6 is equal to paycode 1,12,13
Select Case .Cells(j, 6).Value

Case 1
paycode1 = .Cells(j, 7) * .Cells(j, 11)
.Cells(j, 12) = paycode1
Case 12
paycode12 = .Cells(j, 7) * .Cells(j, 11)
.Cells(j, 12) = paycode12
Case 13
paycode13 = .Cells(j, 7) * .Cells(j, 11)
.Cells(j, 12) = paycode13

'this will look at paycode 1E 1H in j,6
Case "1E"
paycode1E = .Cells(j, 7) * .Cells(j, 11)
.Cells(j, 12) = paycode1E
Case "1H"
payrcode1H = .Cells(j, 7) * .Cells(j, 11)
.Cells(j, 12) = payrcode1H

End Select
Next j
End With
End Sub


"KevinM" wrote:

Thanks Joel. I still get a zero value. Let me back up a bit. Here is the
code I'm using that's using variable "paycode12". I get no error when I run
it but its not giving me the value stored in these variables. If you can
assist me on getting the value out of these variables. I really appreciate
the help. Thanks in advance.


Sub retropay2()

Dim paycode12 As Long
Dim paycode13 As Integer
Dim paycode1E As Integer
Dim paycode1H As Integer
Dim paycode1I As Integer
Dim paycode1J As Integer
Dim paycode1 As Integer
Worksheets("flx00012.tmp").Activate
finalrow1 = Cells(65536, 6).End(xlUp).Row
For j = 1 To finalrow1

'this will see if j,6 is equal to paycode 1,12,13
Select Case Cells(j, 6).Value
Case 1
paycode1=Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)
Case 12
paycode12 = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

Case 13
paycode13 = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

'this will look at paycode 1E 1H in j,6
Case "1E"
paycode1E = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)
Case "1H"
payrcode1H = Cells(j, 12).Formula = Cells(j, 7) * Cells(j, 11)

End Select
Next j
End Sub




"Joel" wrote in message
...
You may have more than one workbook opened. See if this helps

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
with Thisworkbook
paycode12 = .Worksheets("flx00012.tmp").Cells(18, "L").Value
end with
MsgBox (paycode12)


End Sub


"KevinM" wrote:

I'm unable to get the value stored in the variable. I'm not sure what
I'm
doing wrong. I get a value of zero. Here's what I'm doing to check the
value of the data:

Sub SetVarFromCell()
Dim paycode12 As Long


MsgBox (ThisWorkbook.Name & " " & ActiveSheet.Name & " " &
ActiveCell.Address)
MsgBox (ActiveCell.Value)
paycode12 = Worksheets("flx00012.tmp").Cells(18, "L").Value
MsgBox (paycode12)


End Sub


Any help is appreciated.






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
Unable to view column A in spreadsheet [email protected] Excel Discussion (Misc queries) 2 September 12th 08 09:54 PM
Unable to view document C Excel Discussion (Misc queries) 1 September 1st 08 02:35 AM
Unable to view any charts in new worksheet krvenkatesh Charts and Charting in Excel 3 March 10th 08 08:33 PM
Unable to View Sheets in Workbook Thomas M Excel Discussion (Misc queries) 1 November 9th 05 05:40 PM
am unable to view or use sheet tabs dazed and confused New Users to Excel 3 April 12th 05 12:29 AM


All times are GMT +1. The time now is 06:20 AM.

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

About Us

"It's about Microsoft Excel"