LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default VBA Question - Run this code on another column

The following code was provided to me by Tom Ogilvy.

Currently it runs against column C, and I need it to run on column F
instead. I tried experimenting with it to work it out but am getting nowhere
fast.

Can you help?

Thanks in advance.

Scott

Code:

Dim rng2 As Range, cell2 As Range, iloc As Long
Set rng2 = Range(Cells(2, 3), Cells(Rows.Count, 3).End(xlUp))
For Each cell2 In rng2
iloc = InStr(1, cell2, " ", vbTextCompare)
If iloc < 0 Then
cell2.Offset(0, 1).Value = Mid(cell2.Value, iloc + 1, 255)
cell2.Value = Mid(cell2, 1, iloc - 1)
End If
Next
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill column from data (code) in column next to it Matt Excel Worksheet Functions 4 April 24th 09 06:17 PM
VB Code Question Stan Excel Discussion (Misc queries) 2 May 2nd 07 10:13 PM
VB Code Question Stan Excel Discussion (Misc queries) 6 April 30th 07 11:27 PM
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM
Code Question Michael168[_111_] Excel Programming 9 September 17th 04 06:31 AM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"