View Single Post
 
Old 06-08-2017, 01:17 PM
Radtastic10 Radtastic10 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jun 2017
Posts: 5
Radtastic10 is on a distinguished road
Default Multiple Problems with a loop

I am currently having a problem with this loop.

Code:
 last_col = 1
 Do Until IsEmpty(Cells(last_col, 1))
    tempstr = ActiveSheet.Range(last_col & First_row).Value
    If InStr(tempstr, "(Apple)") > 0 Then
       str = Split(last_col & First_row, "(")
       ActiveSheet.Range(last_col & First_row).Value = str & "Red Apple"
    End If
    last_col = last_col + 1
  Loop
It is getting hung up when I try to store the value of the current cell in a temporary string. The goal of the loop is to go through the row of column titles and check if the substring is contained in that cell then switch it to the new title. However, it does not store anything in the temporary string when stepping through the loop.
Reply With Quote