View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_222_] kkknie[_222_] is offline
external usenet poster
 
Posts: 1
Default VBA Formula Question


I'm assuming your issue is how to write it using VBA (the post titl
says that, but the post doesn't). Here's how I would do it:

Sub test()

Dim i As Integer

For i = 1 To 10
Range("B" & i).Value = "=FIND(""&"", A" & i & ")"
Range("C" & i).Value = "=mid(A" & i & ", B" & i & "+1, 5)"
Next

End Sub

One of the keys is to notice that to acutally print a double quot
rather than using it as a string container, you must double it.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26870