Hi
I am new to using VBA code in Excel and I have 2 queries relating to cleaning up the data in a spreadsheet which I am trying to solve.
Is there a way to use or write an Exel function for the user to select a range of numeric and alphanumeric values in one column (eg, 1, 1A, 12, 12B, 39, 39C) and for every cell in the range split off the letter and then automatically place the two separate values (numeric and alpha) in 2 pre-selected cells.
I was thinking of either designing a form in Excel, or using input boxes which would allow a user to select the range for the alphanumeric data to split and also the range for the split data to be placed in for each row in the range selected.
i.e.
Column
1
1A
12
12B
39
39C
would be selected by the user and then they would select the range of two columns for the data to be split into 2 columns
1
1
12
39
39
and
Null
A
Null
B
Null
C
The next question I have is it possible in Excel VBA to allow the user to select different ranges of data using an inpuit box or a form to pass to the function which can then use the data selected to find related values and then aggregate other cells in the range based on the related values?
For example:
if the spreadsheet range is:
A1..D3
and the columns have the following headings and data
Column A[RoundNumber] B[StreetNumber] C[StreetName] D[NoItems]
Line 1 - [1] [23] [High Street] [2]
Line 2 - [1] [25] [High Street] [3]
Line 3 - [1] [27] [High Street] [2]
Line 4 - [2] [2] [Main Street] [1]
Line 5 - [2] [4] [Main Street] [4]
Line 6 - [2] [6] [Main Street] [1]
I want the user to be able to select via a form or an input box any random range in the workbook such as A1..D3 and then select two ranges of related data to be sorted using their related values and also select a range of data to be concatenated based on the data selected and then a range of data to be added together for the related values.
The function would need to identify all values in the range where there are unique values in A1..A6 and each unique value in C1..C6. Therefore for every row in the range where[RoundNumber] =1 and [StreetNumber] = "High Street" then the output to 2 cells further along the spreadsheet would be the concatenation of the value in [StreetNumber] i.e. "23, 25, 27" separated by a comma and the total of [NoItems] i.e. [7].
Sorry if this is not very clear, as its hard to explain. I have attached an image of the input and desired output.
Many thanks for any assistance in trying to crack these.
Regards
Davie