Sunday, March 27, 2016

Solution to Error: 1. How to dissect a group of data/text from a single cell. (macro1)__2. How to reverse this process from 1 question one. (macro2)

1. How to dissect a group of data/text from a single cell. (macro1)__2. How to reverse this process from 1 question one. (macro2)

Question 1;
What if I have another column containing grouped data (B2 & B3).
Or is this impossible because there is an uneven number of variables, 3 materials vs.
6 items.
Example:

    A            B                               C
1  Place     Material                       Item     
2  XYZ1     wood/metal/plastic       2550/2569/3895/3908/12551/12552
3  XYZ2     metal//plastic              C-1344/1348/1355/1365
Part 3: (separate macro button)
Can I reverse this process?

Example:
       A            B            C
1   Place     Material     Item     
3   XYZ1     wood         2550 
4   XYZ1     wood         2569
5   XYZ1     wood         3895
6   XYZ1     wood         3908
7   XYZ1     wood         12551
8   XYZ1     wood         12552
9   XYZ2     metal         C-1344
10  XYZ2    metal         1348
11  XYZ2    metal         1355
12  XYZ2    metal         1365

I seek this result:

    A            B          C
1  Place    Material    Item     
2  XYZ1     wood       2550/2569/3895/3908/12551/12552
3  XYZ2     metal       C-1344/1348/1355/1365

Solutions to the Problem 1. How to dissect a group of data/text from a single cell. (macro1)__2. How to reverse this process from 1 question one. (macro2)

Download SmartPCFixer to Fix It (Free)

Question 1:
Sub Split2Items()
  Dim wshSrc As Worksheet
  Dim wshTrg As Worksheet
  Dim r As Long
  Dim m As Long
  Dim arr() As String
  Dim arr2() As String
  Dim i As Long
  Dim j As Long
  Dim t As Long
  Set wshSrc = ActiveSheet
  m = wshSrc.Range("A" & wshSrc.Rows.Count).End(xlUp).Row
  wshSrc.Copy After:=Worksheets(Worksheets.Count)
  Set wshTrg = Worksheets(Worksheets.Count)
  t = 1
  For r = 2 To m
    arr = Split(wshSrc.Range("B" & r), "/")
    arr2 = Split(wshSrc.Range("C" & r), "/")
    For i = LBound(arr) To UBound(arr)
      For j = LBound(arr2) To UBound(arr2)
        t = t + 1
        wshTrg.Range("A" & t) = wshSrc.Range("A" & r)
        wshTrg.Range("B" & t) = arr(i)
        wshTrg.Range("C" & t) = arr2(j)
      Next j
    Next i
  Next r
End Sub
Question 3a: you can easily expand the macro from my previous reply to concatenate the values from column B at the same time as those from column C.

Run CHKDSK
  • Go to the Start button.
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Restart your computer.

Another Safe way to Repair the Problem: 1. How to dissect a group of data/text from a single cell. (macro1)__2. How to reverse this process from 1 question one. (macro2):

How to Fix 1. How to dissect a group of data/text from a single cell. (macro1)__2. How to reverse this process from 1 question one. (macro2) with SmartPCFixer?

1. You can Download Error Fixer here. Install it on your computer. When you open SmartPCFixer, it will perform a scan.

2. After the scan is finished, you can see the errors and problems need to be repaired. Click Fix All.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been fixed.


Related:
Read More: Troubleshooting:2 problems with Vista and mail on new laptop Error,How to Fix Problem - 10.25.13 Not receiving e-mails?,How Can You Fix - 7210 OfficeJet, Windows 7, Office 2010 when you print Avery labels 8167 the print on the screen is centered, but the labels print to the left and print in the space between the labels?,Troubleshooting:189.11 nvidia driver recovery Error,Troubleshooting:64 bit ram showing 2.7gb when 4gb installed Error,2 home networks and no Internet,24 Hour Time Entry,3gb easy transfer file .mig says no files found when trying to import from Windows XP to Windows 7.,64 MB graphics card and Windows 7,64 bit open gl 1.1

No comments:

Post a Comment