Keep function result after removing referenced column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings:

I have programmed the following formula to extract a substring from
one column on my worksheet to another:

ActiveCell.FormulaR1C1 = "Zone"
Range("C2:C" & LastRow).FormulaR1C1 = "=LEFT(RC[-1], SEARCH(""-"",
RC[-1])-1)"

The problem is that once I have finished extracting my substring, I want
to delete the FROM column while still keeping the results of the function
in the TO column. If I simply delete the FROM column, I get #REF! errors
in all the cells of my TO column.

Can anybody point out a simple way around this problem? Is there a simple
way to convert the function results to a static value and then remove
the FROM column?

Regards,

Charles
 
Select TO column
Copy
PasteSpecial/Values (into the same TO column)

Regards,
Stefi


„Charles in Iraq†ezt írta:
 
Hi Charles

After your code, insert the following 2 lines

Range("C2:C" & LastRow) = Range("C2:C" & LastRow).Value
Columns("B:B").Delete Shift:=xlToLeft
 
Thanks. That worked.

Stefi said:
Select TO column
Copy
PasteSpecial/Values (into the same TO column)

Regards,
Stefi


„Charles in Iraq†ezt írta:
Greetings:

I have programmed the following formula to extract a substring from
one column on my worksheet to another:

ActiveCell.FormulaR1C1 = "Zone"
Range("C2:C" & LastRow).FormulaR1C1 = "=LEFT(RC[-1], SEARCH(""-"",
RC[-1])-1)"

The problem is that once I have finished extracting my substring, I want
to delete the FROM column while still keeping the results of the function
in the TO column. If I simply delete the FROM column, I get #REF! errors
in all the cells of my TO column.

Can anybody point out a simple way around this problem? Is there a simple
way to convert the function results to a static value and then remove
the FROM column?

Regards,

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top