<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can i Convert selected cell range to text in Excel by code stage? in Digital Exchange</title>
    <link>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112871#M3744</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I have 40K rows of data in excel after applying the vlookup formulae. I want to Convert selected cell range to text ,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I tried with the below vba codes, But which is veryslow..&amp;nbsp; Can someone please help me with the code which works fast..&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Dim ws as Object = GetWorksheet(handle,workbook,worksheet)&lt;BR /&gt;Dim cell As Object&lt;BR /&gt;Dim rowRange AS Object&lt;BR /&gt;Dim rowNum As Long&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ws = GetWorkSheet(Handle, Workbook, Worksheet)&lt;BR /&gt;ws.Activate()&lt;BR /&gt;'Specify the range of rows you want to convert&lt;/P&gt;&lt;P&gt;For rowNum = 1 To rowcount 'ws.UsedRange.Rows.Count&lt;BR /&gt;'set the range for the current row&lt;BR /&gt;rowRange = ws.Rows(rowNum)&lt;/P&gt;&lt;P&gt;'Loop through each cell in the cell&lt;/P&gt;&lt;P&gt;For Each cell In rowRange.cells&lt;BR /&gt;'check if the cell contains a formula&lt;BR /&gt;If cell.HasFormula Then&lt;BR /&gt;'Replace the formula with it's current value as text&lt;BR /&gt;cell.Value = cell.Value&lt;BR /&gt;End If&lt;BR /&gt;Next cell&lt;BR /&gt;Next rowNum&lt;/P&gt;</description>
    <pubDate>Sun, 04 Aug 2024 18:56:42 GMT</pubDate>
    <dc:creator>Karthik.choppadandi</dc:creator>
    <dc:date>2024-08-04T18:56:42Z</dc:date>
    <item>
      <title>How can i Convert selected cell range to text in Excel by code stage?</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112871#M3744</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I have 40K rows of data in excel after applying the vlookup formulae. I want to Convert selected cell range to text ,&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I tried with the below vba codes, But which is veryslow..&amp;nbsp; Can someone please help me with the code which works fast..&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Dim ws as Object = GetWorksheet(handle,workbook,worksheet)&lt;BR /&gt;Dim cell As Object&lt;BR /&gt;Dim rowRange AS Object&lt;BR /&gt;Dim rowNum As Long&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ws = GetWorkSheet(Handle, Workbook, Worksheet)&lt;BR /&gt;ws.Activate()&lt;BR /&gt;'Specify the range of rows you want to convert&lt;/P&gt;&lt;P&gt;For rowNum = 1 To rowcount 'ws.UsedRange.Rows.Count&lt;BR /&gt;'set the range for the current row&lt;BR /&gt;rowRange = ws.Rows(rowNum)&lt;/P&gt;&lt;P&gt;'Loop through each cell in the cell&lt;/P&gt;&lt;P&gt;For Each cell In rowRange.cells&lt;BR /&gt;'check if the cell contains a formula&lt;BR /&gt;If cell.HasFormula Then&lt;BR /&gt;'Replace the formula with it's current value as text&lt;BR /&gt;cell.Value = cell.Value&lt;BR /&gt;End If&lt;BR /&gt;Next cell&lt;BR /&gt;Next rowNum&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2024 18:56:42 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112871#M3744</guid>
      <dc:creator>Karthik.choppadandi</dc:creator>
      <dc:date>2024-08-04T18:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can i Convert selected cell range to text in Excel by code stage?</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112988#M3750</link>
      <description>&lt;P&gt;This code should convert your 40K rows of data from formulas to plain text much faster than the original method you tried.&amp;nbsp;You can optimize the code by avoiding unnecessary loops and making use of Excel's native functions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub ConvertRangeToText()&lt;BR /&gt;Dim ws As Worksheet&lt;BR /&gt;Dim rng As Range&lt;BR /&gt;Dim cell As Range&lt;BR /&gt;Dim dataArray As Variant&lt;BR /&gt;Dim rowNum As Long, colNum As Long&lt;BR /&gt;&lt;BR /&gt;' Set the worksheet and the range you want to convert&lt;BR /&gt;Set ws = ThisWorkbook.Sheets("Sheet1") ' Change to your sheet name&lt;BR /&gt;Set rng = ws.UsedRange ' Change to the specific range if needed&lt;/P&gt;&lt;P&gt;' Turn off screen updating and calculation to speed up the process&lt;BR /&gt;Application.ScreenUpdating = False&lt;BR /&gt;Application.Calculation = xlCalculationManual&lt;/P&gt;&lt;P&gt;' Read the data into a variant array&lt;BR /&gt;dataArray = rng.Value&lt;/P&gt;&lt;P&gt;' Loop through the array and replace formulas with their values&lt;BR /&gt;For rowNum = 1 To UBound(dataArray, 1)&lt;BR /&gt;For colNum = 1 To UBound(dataArray, 2)&lt;BR /&gt;If Left(CStr(rng.Cells(rowNum, colNum).Formula), 1) = "=" Then&lt;BR /&gt;dataArray(rowNum, colNum) = rng.Cells(rowNum, colNum).Text&lt;BR /&gt;End If&lt;BR /&gt;Next colNum&lt;BR /&gt;Next rowNum&lt;BR /&gt;&lt;BR /&gt;' Write the array back to the range&lt;BR /&gt;rng.Value = dataArray&lt;/P&gt;&lt;P&gt;' Turn on screen updating and calculation&lt;BR /&gt;Application.ScreenUpdating = True&lt;BR /&gt;Application.Calculation = xlCalculationAutomatic&lt;/P&gt;&lt;P&gt;MsgBox "Conversion to text completed!"&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 09:22:38 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112988#M3750</guid>
      <dc:creator>Parthiban_Viatris24</dc:creator>
      <dc:date>2024-08-09T09:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can i Convert selected cell range to text in Excel by code stage?</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112994#M3751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/59284"&gt;@Karthik.choppadandi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think a code stage might be an overly complicated solution, the easiest thing to do would be to copy and paste the rows as values. If your formula has produced results and you want now only the values from the formulas then you can select all the rows you need and then copy and paste either into the same rows as they currently are into new cells and in this action select values for the paste option. example below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="michaeloneil_0-1723200548022.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/39096i879C4CE41F3E5555/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="michaeloneil_0-1723200548022.png" alt="michaeloneil_0-1723200548022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 10:49:27 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/How-can-i-Convert-selected-cell-range-to-text-in-Excel-by-code/m-p/112994#M3751</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2024-08-09T10:49:27Z</dc:date>
    </item>
  </channel>
</rss>

