Put dots in your data in Excel with VBA



Put dots in your data in Excel with VBA. Change a string 1000 ways with dots. Check out my online courses www.easyexcelanswers.com/courses.html
All my courses include online support and a user manual
Let me teach you the VBA that I have learn in my five years of consulting

Let’s take the frustration out of user forms

Become an Affiliate and earn 25% on Course Sales

For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Click for online Excel Consulting

I am able to provide online help on your computer at a reasonable rate.

I use a Blue condenser Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

TWEET THIS VIDEO

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.

code
Sub putdots()
Dim r, c As Long
Dim stext, otp As String
Dim col As Long
Dim ltxt As Long
r = 3
c = 2

For r = 3 To 1000
‘define the string that we are trying to manipulate
stext = Sheet1.Cells(r, c).Value

col = 5
Do While col (less than) 18
‘looking for where the dots go
If Sheet1.Cells(r, col).Value (does not equal) “x” Then
GoTo ncol
Else
‘find the spot where the dot goes
spt = Sheet1.Cells(1, col).Value
‘have we already changed this string
If Sheet1.Cells(r, 18).Value (does not equal) “” Then
GoTo more
Else
‘this is where we put the first dot in
Sheet1.Cells(r, 18).Value = Left(stext, (Len(stext) – spt)) & “.” & Right(stext, spt)
‘defining the output in case we have to do further maniputlation
otp = Sheet1.Cells(r, 18).Value
GoTo ncol
End If

End If
more:
‘if we have already put a dot in then we are going to change at the output
Sheet1.Cells(r, 18).Value = Left(otp, (Len(otp) – spt)) & “.” & Right(otp, spt)
otp = Sheet1.Cells(r, 18).Value
ncol:
col = col + 1
Loop

Next r
End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận