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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
VBA Code:
Sub ConvertToValues()
[E1:E20] = [C1:C20].Value
End Sub
 
Upvote 0
this was so easy! im new to vba so thanks for helping out . appreciate it.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

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
Back
Top