ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   PETTY CASH (https://www.excelbanter.com/excel-worksheet-functions/248828-petty-cash.html)

josros60 via OfficeKB.com

PETTY CASH
 
Hi,

I have a petty cash sheet, and there's one column for miscellaneous account,
so i have data validation list box so when i pick the account shows the
description and account but then i just want to display the account number
after i selected,by the way i have petty cash sheet and code sheet where it
pull the account from.

here it's the code for the petty cash sheet: ( i don't know what i am doing
wrong it display it put both but i just want the account number.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo errHandler
If Target.Cells.Count 1 Then GoTo exitHandler
If Target.Column = 2 Then
If Target.Value = "" Then GoTo exitHandler
Application.EnableEvents = False
Target.Value = Worksheets("Codes").Range("A1") _
.Offset(Application.WorksheetFunction _
.Match(Target.Value, Worksheets("Codes").Range("ProdList"), 0), 0)
End If

exitHandler:
Application.EnableEvents = True
Exit Sub

errHandler:
If Err.Number = 13 Or Err.Number = 1004 Then
GoTo exitHandler
Else
Resume Next
End If

End Sub



(is there anyway i can post the file so it's easy to know what i am talking
about, if any body want to use it, it's OK.

Thank you very much for your help

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200911/1



All times are GMT +1. The time now is 02:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com