View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default vba format question

cells(1).value = 3
With code I would like to convert this value into 03 for use elsewhere
ie:show single digit numbers as 2 digit in a message box
I've tried variations of the code below but no joy so far

dim txt as string
txt = format(cells(1).value, "00")
msgbox txt