Re: Bill of material-conditional transpose
Hello, would you like to share the data, so that it can be formatted?
Thanks,
Re: Bill of material-conditional transpose
Hello, would you like to share the data, so that it can be formatted?
Thanks,
Re: sum and average based on month and year
Please see the attachment. Have tried to get the desired result using SumProduct.
Thanks,
Re: How does excel read the ~ symbol
Please try searching for char(126) in Excel.
Thanks,
Re: Allocating division spending to projects (2 tables to 1)
I have used Sumproduct formula to get the desired result. Please see the attachment. The formula works in the same way as the worksheet function 'Sumifs' (which sums a range if multiple criteria are fulfilled) available in Excel 2007.
Please revert if there is anything not fully clear.
Thanks,
Regards,
Re: Show matching value per drop down selection of two dependent lists
[FONT="]One option is to use two combo boxes and have the two separate lists as their ‘Input Range’ and a common ‘Cell Link’.
Regards,
[/FONT]
The attached ad-in is a simple tool to cater to requirements of those working in Text in Excel, who might need to change text to;
i) Lower Case
ii) Upper Case, or
iii) Proper Case,
often and would like to have relevent menu available on the Formatting Toolbar.
This Ad In has been tested in Excel 2002 and may need to be modified for other versions.
To make it work, please save the attachment to a location, and then use Browse button to locate the saved file from Tools-->Add-Ins submenu in Excel.
The Buttons added can be customized using Customize Toolbars option.
Have your way with working with Text a little more easily!
Regards,
Hyder
Re: Extract/Parse Out Specific Data From Multiple Text Files
Dear macarius,
There are only 2 changes. Have made the first line (which adds a new workbook) a comment. Further, the code looks up for a sheet named "Impedance" in the Active workbook and starts putting in the data from cell A1 (i=1 is the 1st row in the Sheet). You can change value of i below to the row you desire to have the placing of data started from in the Worksheet.
Thanks,
Regards,
Sub read_text()
'Set wb = Workbooks.Add
workingflnm = ActiveWorkbook. Name
i = 1 'First row in Active Sheet
Set fd = CreateObject("Scripting.Filesystemobject")
pthnm = "C:\Log Files\" 'Please change to your desired folder
Set fs = fd.GetFolder(pthnm)
For Each fl In fs.Files
If InStr(1, fl.Name, "Log", vbTextCompare) > 0 Then
Set Txtobj = CreateObject("Scripting.filesystemobject")
Set Txtfl = Txtobj.getfile(fl)
Set Txtstrm = Txtfl.openastextstream(1, -2)
Do While Txtstrm.atendofstream <> True
rdln = Txtstrm.readline
If InStr(1, rdln, "PCU Resistance", vbTextCompare) > 1 Then
x1 = InStr(1, rdln, "PCU Resistance", vbTextCompare)
x2 = InStr(1, rdln, "Ohms", vbTextCompare)
Workbooks(workingflnm).Sheets("Impedance").Cells(i, 1) = fl.Name
' Construction of Ohms String
strg = Mid(rdln, x1 + Len("PCU Resistance"), x2 + Len("Ohms") - (x1 + Len("PCU Resistance"))) 'The String picks the character Ohms in the Line as well
Workbooks(workingflnm).Sheets("Impedance").Cells(i, 2) = strg
i = i + 1
End If
Loop
End If
Next
End Sub
Display More
Re: Extract/Parse Out Specific Data From Multiple Text Files
As regards the usefulness of this resource, I would say that when in a fix, I expect to find a solution to my problem here or at the least a useful hint to one; the site is rich with remarkably creative content.
Regards,
Hyder
Re: Extract/Parse Out Specific Data From Multiple Text Files
Thanks. Glad it worked for you. Think, a link to this forum topic shall be sufficient):
Regards,
Re: Extract/Parse Out Specific Data From Multiple CSV Files
Please try by customizing the folder and placing this code in a module.
Regards,
Sub read_text()
Set wb = Workbooks.Add
workingflnm = ActiveWorkbook.Name
i = 1 'First row in Active Sheet
Set fd = CreateObject("Scripting.Filesystemobject")
pthnm = "C:\Log Files\" 'Please change to your desired folder
Set fs = fd.GetFolder(pthnm)
For Each fl In fs.Files
If InStr(1, fl.Name, "Log", vbTextCompare) > 0 Then
Set Txtobj = CreateObject("Scripting.filesystemobject")
Set Txtfl = Txtobj.getfile(fl)
Set Txtstrm = Txtfl.openastextstream(1, -2)
Do While Txtstrm.atendofstream <> True
rdln = Txtstrm.readline
If InStr(1, rdln, "PCU Resistance", vbTextCompare) > 1 Then
x1 = InStr(1, rdln, "PCU Resistance", vbTextCompare)
x2 = InStr(1, rdln, "Ohms", vbTextCompare)
Workbooks(workingflnm).Sheets(1).Cells(i, 1) = fl.Name
'Construction of Ohms String
strg = Mid(rdln, x1 + Len("PCU Resistance"), x2 + Len("Ohms") - (x1 + Len("PCU Resistance"))) 'The String picks the character Ohms in the Line as well
Workbooks(workingflnm).Sheets(1).Cells(i, 2) = strg
i = i + 1
End If
Loop
End If
Next
End Sub
Display More
Re: Determine Last Modified Date
FSO is FileSystemObject. To copy the code from the thread titled at the left in the header 'Date Last Modified from CSV File" written by friend Jindon;
Sub test()
Dim fso As Object, myDir As String, fn As String, myFile As String, myDate As Date, maxDate As Date
Set fso = CreateObject("Scripting.FileSystemObject")
myDir = "C:\temp" 'Change to your desired directory
fn = Dir(myDir & "\*.csv)
Do While fn <> ""
myDate = fso.GetFile(myDir & "\" & fn).DateCreated
If maxDate < myDate Then
myFile = fn
maxDate = myDate
End If
fn = Dir()
Loop
MsgBox myDir & "\" & fn & " : " & maxDate
End Sub
Display More
The last line in the code gives the DataCreated (maxDate in the above code) for the CSV file in a message box. You might like to return this result on top of your pivot table.
Hope that helps.
Regards,
Re: Filterable Dynamic Chart Range
Although, I doubt that this could be the solution to your problem; as you have already got the desired result when you use direct cell references instead of named ranges.
Regards,
Re: Filterable Dynamic Chart Range
If you are working in Excel 2003, please also ensure that you have checked the Option "Plot visible cells only" under Tools-Options-Chart Tab.
Regards,
Re: Fill Range Down N Cells & Increment By X
I assume that in all 84 cycles you wish to add 200 to every first number of the previous cylce, repeating the new number in the next 50 rows. If so, this code will accomplish that. Regards,
Sub Macro1()
Const Increment = 200
Const Cycle = 84 'You may change the number of repetitions of pasting data
Const Datalastrow = 50 'You may change the last row number of your data
Counter = 1
j = 1
Do While Counter <= Cycle
Do
Sheets("Sheet1").Cells(Datalastrow + j, 1) = Sheets("Sheet1").Cells(j, 1) + Increment
j = j + 1
Loop Until j = Datalastrow * Counter + 1
Counter = Counter + 1
Loop
End Sub
Display More
Re: Transfer Data To Closed Workbook And Print
It could be done like this;
Private Sub CommandButton45_Click()
Dim wbPrint As Workbook
Application.ScreenUpdating = False
Set wbPrint = Workbooks.Open("c:\Receipt Form.xls")
With wbPrint.Sheets("Driver")
For i = 72 To 86
If ThisWorkbook.Sheets("Stats").Cells(i, 4) <> "" Then
ThisWorkbook.Sheets("Stats").Cells(i, 4).Copy Destination:=.Cells(3, 2)
.PrintOut
End If
Next
wbPrint.Close savechanges:=False
End With
End Sub
Display More
Regards,
Re: Pasting N Times
Please try this by pasting in any module. Regards,
Sub Macro1()
Const increment = 200
Const Cycle = 84
counter = 1
j = 1
Do While counter < Cycle
Do
Sheets("Sheet1").Cells(51 + j, 1) = Sheets("Sheet1").Cells(j, 1)
Sheets("Sheet1").Cells(51 + j, 2) = Sheets("Sheet1").Cells(j, 2) + increment
j = j + 1
Loop Until j = 51 * counter + 1
counter = counter + 1
Loop
End Sub
Display More
Re: Linked List With Class Procedure
I have tried to modify the code not knowing, what you had in mind, but the code is executing. Please see if you can make it work.
Regards,
Function MakeCell()
Dim Cell1 As New ConsCell ''To connect to the defined Class
Cell1.Car = 15
Cell1.Cdr = "NIL"
MakeCell = Cell1.Car & Cell1.Cdr
End Function
Re: Move & Transpose Columns to Rows
The code below shall raise a prompt twice; first to select the cell to paste the data from Java File, second to place the transposed data pasted after successfully executing the first step.
Regards,
Sub Jay()
Dim xadd, xpaste As Range
Start:
On Error Resume Next
Set xadd = Application.InputBox("Please select the range to paste the data from Java File", "Paste from Java File", Type:=8)
If Err.Number <> 0 Then
MsgBox Err.Description & ", " & Err.Number, vbOKOnly, "Error"
Exit Sub
End If
If Not xadd Is Empty And Err.Number <> 13 Then
xadd.Select
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, _
DisplayAsIcon:=False
Else
GoTo Start
End If
Start2:
Set xpaste = Application.InputBox("Please select the range to paste the transposed data", "Select a cell for pasting transposed data", Type:=8)
'Copy the data and Paste after Transposing in the selected cell
If Not xpaste Is Nothing Then
Range(xadd, xadd.Offset(2, 0)).Copy
xpaste.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Else
MsgBox "Please enter a valid range to paste the data", vbOKOnly
GoTo Start2
End If
Range(xadd, xadd.Offset(2, 0)).Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Display More