VBA parsing as a string help and using string.replace

aedctalk

Board Regular
Joined
Oct 9, 2010
Messages
156
In the following bit of code, how would i parse or convert adoRS(2) to a string please (? I'm a bit new to parsing/converting to strings.. :/

also (less important) but if you could also tell me.. how i'd do the following that would be a huge huge help.

adoRS(2) is a sentance/message

Code:
[COLOR=#1f497d]Do While adoRS.EOF <> True<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[/COLOR]
[COLOR=#1f497d]        If Range("A" & x).Value <> "" Then<o:p></o:p>[/COLOR]
[COLOR=#1f497d]            If adoRS(0) & "" = Split(Range("A" & x).Value, " ")(0) Then<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                Range(comments & x) = adoRS(2)<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                adoRS.MoveNext<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                If adoRS.EOF = True Then<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                    Exit Do<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                End If<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                If adoRS(1) > 0 And adoRS.EOF <> True Then<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                    Do While adoRS(1) <> 0<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        x = x + 1<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        Rows(x).EntireRow.Insert<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        Range("A" & x) = adoRS(0)<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        Range(comments & x) = adoRS(2)<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        adoRS.MoveNext<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        If adoRS.EOF = True Then<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                            Exit Do<o:p></o:p>[/COLOR]
[COLOR=#1f497d]                        End If<o:p></o:p>[/COLOR]
[COLOR=#1f497d]           [/COLOR]


after adoRS(2) is converted to a string I need adoRS(2) i need to run a replace string as well. how coudl i run the following code on adoRS(2) after i have converted it?

string.replace(“=> “, “”).

Thank you so much for any help!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top