Feb 01 2021 07:25 PM
Feb 01 2021 07:25 PM
I answered my first question by checking one of my other sheets, but this one is a bit trickier.
When people use MS Forms, even for questions I have added restrictions to so it must be a number, in the associated spreadsheet, the data is presented as text, specifically: '2, '3 etc.
This obviously then limits options as far as what can be done with the data, conditional formatting, calculations, etc, all go out the window.
This vid has a serviceable couple of solutions if it was a one off problem, however, this is a table being updated from form responses, and I'd like to remove the apostrophes as soon as new data is in there, automatically. (Regular formatting doesn't do the job.)
(I could not get the VBA solution offered in below video to work, unsure if I messed up, or if the fact it's dealing with a table makes a difference.)
Feb 01 2021 10:04 PM
Well, this is not a perfect solution, but if you set up a flow with power automate, the data can be dumped to a different spreadsheet and stays as numbers.
Feb 01 2021 11:57 PM
I see no reason why the macro solution should not work provided your worksheet is 'Sheet1' and the data is brought into column 1. Since you say you are using Excel Tables, it would be a more precise way of defining the range to edit to use the column of the list object as opposed to sheet-based references.
Feb 02 2021 01:07 AM
Sub TextToNumber() Dim LO As ListObject Set LO = ActiveSheet.ListObjects(1) With LO.ListColumns(1).Range .NumberFormat = "General" .Value = .Value End With End Sub
[The Table name or column name could be used in place of its index]
Feb 02 2021 01:15 AM
I guess the Form is linked to Excel file hosted on SharePoint site. That issue is known for years, at least two workarounds
1) If you have column [Question 1] which have number as text, you may add to the table additional column Q1 as =@[Question 1]*1, or =CLEAN(@[Question 1])*1, etc and work with these columns. Adding of additional columns into the forms table won't crash the process.
2) Instead of linked table use Power Automate which is triggered by form submit and adds rows to the table in your file. In this case not linked with the Form. Transformation could be done within Power Automate flow.
Feb 02 2021 10:15 PM
Feb 02 2021 10:19 PM
Feb 03 2021 04:16 AM
Feb 03 2021 03:06 PM
It's always better to split Excel workbook on 3 zones
- source/raw data
- data preparation
First is filled automatically by SharePoint app triggered by Forms
- in second you may generate any table and perform any calculation to transform data
- in third could be PivotTables / Charts based on second part.
Jul 27 2021 01:58 PM