convert value to text vba

Namratak

New Member
Joined
Jun 11, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
hi, im trying to copy range C (which is referenced from another sheet) into range E and then convert it to text because I want to split column E into words later. the code just shows 0 output in the cells of E. can you pls help with the error. and what will be the formula for splitting it into words?

VBA Code:
Sub ConvertToValues()
Dim MyRange As Range
Dim MyCell As Range

Range("C1:C20").Copy Destination:=Range("E1:E20")

Set MyRange = Range("E1:E20")
For Each MyCell In MyRange
If MyCell.HasFormula Then
MyCell.Formula = MyCell.Value
End If
Next MyCell
End Sub
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
3,206
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:
Sub ConvertToValues()
[E1:E20] = [C1:C20].Value
End Sub
 

Namratak

New Member
Joined
Jun 11, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
this was so easy! im new to vba so thanks for helping out . appreciate it.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,944
Messages
5,621,753
Members
415,854
Latest member
Tutu123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top