Thread: text to columns
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
danpt danpt is offline
external usenet poster
 
Posts: 49
Default text to columns

Sorry, Rick
It was my gross mistake. I understand how the dot works now.
Many thanks!


"Rick Rothstein" wrote:

A second look at your original script, the only change that was actually
needed:
from LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
to LastRow = Cells(.Rows.Count, "A").End(xlUp).Row


Why do you think that change is necessary? The "dot" in front of "Cells"
makes it reference the worksheet set in the With statement... without the
"dot", the reference is to the ActiveSheet which theoretically could be
different from the worksheet referenced in the With statement. Put the "dot"
back in.

Cells(X, "B") = Number
Cells(X, "C") = Trim(Word)


Also put a "dot" in front of the above two Cells references that you added
toward the end of the code (for the same reason).

--
Rick (MVP - Excel)