Mar 1, 2011 #1 S sunnyfunghy Member level 1 Joined Aug 12, 2008 Messages 36 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,502 Hi everyone, how to write a program below in excel using visual Basic 1. Write a program to calculate (i) the total number of characters (excluding punctuation marks) in each cell in an Excel file (ii) the number of characters before the first occurrence of "," For example: ABCDE,FGH. Answer 1i) 8 2)5 Many thanks^^
Hi everyone, how to write a program below in excel using visual Basic 1. Write a program to calculate (i) the total number of characters (excluding punctuation marks) in each cell in an Excel file (ii) the number of characters before the first occurrence of "," For example: ABCDE,FGH. Answer 1i) 8 2)5 Many thanks^^
Mar 1, 2011 #2 Q qieda Full Member level 3 Joined Aug 15, 2006 Messages 150 Helped 47 Reputation 94 Reaction score 47 Trophy points 1,308 Activity points 2,174 do you want to use VBasic, or would it be ok to use excel functions e.g. if your string is in cell A1 =LEN(A1) gives the length of 8 =SEARCH(",",A1)-1 gives the length of 5 regards
do you want to use VBasic, or would it be ok to use excel functions e.g. if your string is in cell A1 =LEN(A1) gives the length of 8 =SEARCH(",",A1)-1 gives the length of 5 regards
Mar 1, 2011 #3 S sunnyfunghy Member level 1 Joined Aug 12, 2008 Messages 36 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,502 qieda said: do you want to use VBasic, or would it be ok to use excel functions e.g. if your string is in cell A1 =LEN(A1) gives the length of 8 =SEARCH(",",A1)-1 gives the length of 5 regards Click to expand... Thank you but if like this, and I want to do in visual Basic e.g. abcde,bcdef,jkl. Total: 13 before "." and excluding "." Thanks a lot^^ ---------- Post added at 11:09 ---------- Previous post was at 10:09 ---------- Besides, I also discover that when "=SEARCH(",",A1)-1" this command code uses to count Chinese word, there is an error. So how to change? Many thanks
qieda said: do you want to use VBasic, or would it be ok to use excel functions e.g. if your string is in cell A1 =LEN(A1) gives the length of 8 =SEARCH(",",A1)-1 gives the length of 5 regards Click to expand... Thank you but if like this, and I want to do in visual Basic e.g. abcde,bcdef,jkl. Total: 13 before "." and excluding "." Thanks a lot^^ ---------- Post added at 11:09 ---------- Previous post was at 10:09 ---------- Besides, I also discover that when "=SEARCH(",",A1)-1" this command code uses to count Chinese word, there is an error. So how to change? Many thanks