VBA Function

adeel1
3StarLounger
Posts: 264
Joined: 04 Oct 2017, 15:47

VBA Function

Post by adeel1 »

Hello All

Refer to Attachment, there is some cell are blanks

i am more interested in trouble shooting, when i turn in simple VBA its working
Adeel

Code: Select all

Function vccb(a As Range) As Long
p = Cells(Rows.Count, 1).End(3).Row
For i = 2 To p
For ii = 1 To Len(a)
x = x & Asc(Mid(a, ii, 1)) - 64
Next ii
vccb = x
x = ""
Next i
End Function
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA Function

Post by HansV »

The values of some cells are too long for the result to fit in a variable of type Long. Change the return type of vccb from Long to String or to Double.
Best wishes,
Hans

adeel1
3StarLounger
Posts: 264
Joined: 04 Oct 2017, 15:47

Re: VBA Function

Post by adeel1 »

works :clapping: :clapping: thnx
thnx for fast reply

Adeel