Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Claus Busch wrote:
Hi Terry, Am Wed, 29 Jan 2020 17:49:49 +0000 schrieb Terry Pinnell: Thanks Claus, very grateful for your help. I'm confident your code is VERY close to working but it's giving some incorrect results at present. I've included a link to the test workbook WalkIndex-Claus.xlsm so that you can see what I mean in detail. Should have done that in my original post, sorry. https://www.dropbox.com/s/xbwgtqs23z...aus.xlsm?raw=1 try: Dim objData As New MSForms.DataObject Dim tAll_VBA Dim strCols As String Dim strValues As String 'Types for these arrays? Dim varTmp As Variant Dim varCols As Variant Dim varValues As Variant Dim LRow As Long Dim i As Integer objData.GetFromClipboard tAll_VBA = objData.GetText() 'For testing MsgBox tAll_VBA Debug.Print tAll_VBA 'Now need to get that into a new row of WI 'This block from Claus strCols = "A,B,C,H,I,J,K,L,M,N,O,P,R,S,T,U,V,W" varCols = Split(strCols, ",") strValues = "3,4,2,10,8,5,6,7,9,11,12,13,14,15,16,17,18,19 " varValues = Split(strValues, ",") varTmp = Split(tAll_VBA, Chr(10)) With Sheets("Target") LRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1 For i = LBound(varCols) To UBound(varCols) Select Case varCols(i) Case "J", "K", "L" .Cells(LRow, varCols(i)) = Format(varTmp(varValues(i)), "hh:mm") Case Else .Cells(LRow, varCols(i)) = varTmp(varValues(i)) End Select Next End With Or download the workbook from he https://1drv.ms/x/s!AqMiGBK2qniTgel7...Xqp_g?e=ISgyGm Regards Claus B. Excellent, works perfectly now, thanks a lot Claus ;-) One minor point that probably has a simple answer; did you notice that the entries in cols N, O and P are red? The cols are not formatted with red font so I'm puzzled. Terry, UK |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable series multi line chart? | Charts and Charting in Excel | |||
Macro to validate is cell is not empty and copy the line | Excel Programming | |||
Copy row to next empty line | Excel Programming | |||
Copy and Paste in the first empty available line. | Excel Programming | |||
copy/paste excel to texteditor -> multi-line text cells gain unwanted double-quotes | Excel Discussion (Misc queries) |