Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Filter using Mid

Hi,

I have been going around and aroung with this. I am trying to filter to the
6th digit of a string. My variables show the correct values when I step
through this yet it does not fall into the call. Here is my code:

Sub AddCAMLineItem()

Dim NuRow As Long
Dim ItemCol As String
Dim EndItemCol As String
Dim NuCostCode As String
Dim NuLineItem As String
Dim NuItemAmount As Long
Dim CodeType As String
Dim StartRow As Long
Dim Lusedrow As Long

StartRow = 4
NuLineItem = frmPoolList.txtNewPoolType.Value
NuItemAmount = Val(frmPoolList.txtLineItemAmount.Value)
NuCostCode = Left(frmPoolList.txtNewPoolType.Value, 9)
CodeType = Mid(NuCostCode, 6, 1)

If InStr("Tax", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
Else
If InStr("TAX", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
End If
End If

Select Case CodeType
Case CodeType = "0"
Call AddCAMExteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
Case CodeType = "1"
Call AddCAMInteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
End Select

ContTax:

End Sub

Right now I am working with the Exterior Line Item. The NuCostCode is
"6128-0000" which in turn has a CodeType of "0" in the 6th digit. This value
shows in step through but the code does not drop into the Call
AddCAMExteriorItem statement. What am I missing?
--
Thanks for your help.
Karen53
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Filter using Mid

Hi Karen,

Try:-

Case "0"

--
Regards,

OssieMac


"Karen53" wrote:

Hi,

I have been going around and aroung with this. I am trying to filter to the
6th digit of a string. My variables show the correct values when I step
through this yet it does not fall into the call. Here is my code:

Sub AddCAMLineItem()

Dim NuRow As Long
Dim ItemCol As String
Dim EndItemCol As String
Dim NuCostCode As String
Dim NuLineItem As String
Dim NuItemAmount As Long
Dim CodeType As String
Dim StartRow As Long
Dim Lusedrow As Long

StartRow = 4
NuLineItem = frmPoolList.txtNewPoolType.Value
NuItemAmount = Val(frmPoolList.txtLineItemAmount.Value)
NuCostCode = Left(frmPoolList.txtNewPoolType.Value, 9)
CodeType = Mid(NuCostCode, 6, 1)

If InStr("Tax", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
Else
If InStr("TAX", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
End If
End If

Select Case CodeType
Case CodeType = "0"
Call AddCAMExteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
Case CodeType = "1"
Call AddCAMInteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
End Select

ContTax:

End Sub

Right now I am working with the Exterior Line Item. The NuCostCode is
"6128-0000" which in turn has a CodeType of "0" in the 6th digit. This value
shows in step through but the code does not drop into the Call
AddCAMExteriorItem statement. What am I missing?
--
Thanks for your help.
Karen53

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Filter using Mid

Thank you OssieMac!
--
Thanks for your help.
Karen53


"OssieMac" wrote:

Hi Karen,

Try:-

Case "0"

--
Regards,

OssieMac


"Karen53" wrote:

Hi,

I have been going around and aroung with this. I am trying to filter to the
6th digit of a string. My variables show the correct values when I step
through this yet it does not fall into the call. Here is my code:

Sub AddCAMLineItem()

Dim NuRow As Long
Dim ItemCol As String
Dim EndItemCol As String
Dim NuCostCode As String
Dim NuLineItem As String
Dim NuItemAmount As Long
Dim CodeType As String
Dim StartRow As Long
Dim Lusedrow As Long

StartRow = 4
NuLineItem = frmPoolList.txtNewPoolType.Value
NuItemAmount = Val(frmPoolList.txtLineItemAmount.Value)
NuCostCode = Left(frmPoolList.txtNewPoolType.Value, 9)
CodeType = Mid(NuCostCode, 6, 1)

If InStr("Tax", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
Else
If InStr("TAX", NuLineItem) Then
Call AddTaxItem(StartRow, Lusedrow, ItemCol, EndItemCol)
GoTo ContTax
End If
End If

Select Case CodeType
Case CodeType = "0"
Call AddCAMExteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
Case CodeType = "1"
Call AddCAMInteriorItem(StartRow, Lusedrow, ItemCol,
EndItemCol)
End Select

ContTax:

End Sub

Right now I am working with the Exterior Line Item. The NuCostCode is
"6128-0000" which in turn has a CodeType of "0" in the 6th digit. This value
shows in step through but the code does not drop into the Call
AddCAMExteriorItem statement. What am I missing?
--
Thanks for your help.
Karen53

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
Filter PivotTable dropdown items to match report filter Catherine D Excel Discussion (Misc queries) 1 August 16th 08 12:12 AM
Copy only visible cells after filter is applied/ sum after filter MAM Excel Worksheet Functions 0 April 9th 08 04:09 AM
filter: how to print filter list options in dropdown box help please Excel Discussion (Misc queries) 2 October 17th 07 01:53 AM
Need macro to filter, create tab on filter and copy/paste Jen[_11_] Excel Programming 1 May 2nd 06 04:45 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM


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