Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CAM CAM is offline
external usenet poster
 
Posts: 65
Default Using lookup

Hello,

I have a worksheet called "ChartOfAccounts", which contains chart of
accounts - account number and description. I have another worksheet called
"MonthlyExpense" containing expenses for the month. What I want is to do a
lookup matching the worksheet "MonthlyExpense" with "ChartOAccounts.
Example: In the "MonthlyExpense" worksheet there is an account number
"AT2543050509" I want to match with the corresponding account number from
the "ChartOfAccount" worksheet called "Dues and subscription" account
number "ATXX43050509" the XX in the "ChartOfAccounts" is for the department
number, which varies. I want to somehow match "AT2543050509" from the
"MonthlyExpense" worksheet with "ATXX43050509" from the "ChartOfAccount"
worksheet. How do I do that? My problem is that the 3rd and 4th digit in
the "ChartOfAccounts" contains the "XX". Any tips will be appreciated. I
am using Excel 2007. Thank you in advance.

Cheers

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Using lookup

Arrange to scan your ChartOAccounts list for each MonthAccount and use a
version of the following logic to test for a matching string using the like
function.... example code below


Dim sTestString As String
Dim sMonthAccount As String
Dim sChartOAccounts As String

sMonthAccount = "AT1234567890"
sChartOAccounts = "ATXX34567890"

sTestString = Left(sMonthAccount, 2) & _
"**" & _
Mid(sMonthAccount, 5, Len(sMonthAccount) - 4)

If sChartOAccounts Like sTestString Then

' code for a match

End If

--

Regards,
Nigel




"CAM" wrote in message
...
Hello,

I have a worksheet called "ChartOfAccounts", which contains chart of
accounts - account number and description. I have another worksheet called
"MonthlyExpense" containing expenses for the month. What I want is to do
a
lookup matching the worksheet "MonthlyExpense" with "ChartOAccounts.
Example: In the "MonthlyExpense" worksheet there is an account number
"AT2543050509" I want to match with the corresponding account number from
the "ChartOfAccount" worksheet called "Dues and subscription" account
number "ATXX43050509" the XX in the "ChartOfAccounts" is for the
department
number, which varies. I want to somehow match "AT2543050509" from the
"MonthlyExpense" worksheet with "ATXX43050509" from the "ChartOfAccount"
worksheet. How do I do that? My problem is that the 3rd and 4th digit in
the "ChartOfAccounts" contains the "XX". Any tips will be appreciated.
I
am using Excel 2007. Thank you in advance.

Cheers


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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Lookup looks to the prior column if zero appears in the lookup col kenbquik Excel Discussion (Misc queries) 2 March 12th 09 03:41 AM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM


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