Function Code So That Instead Of Appending MyDate
Jan 24, 2007
I am having problems fixing my function code so that instead of appending myDate with (1) (2) (3) if 3 occurences of the date already exist it just appends it with (3). I know it has to be something simple but I know I am doing something wrong. Thanks for helping a beginner out.
Sub ImportSheets()
Dim fName As String
Dim WB As Workbook
Dim myDate As Date
fName = Dir("N:ENGBRANDON*.csv")
Do While fName ""
Workbooks.Open fName
Set WB = ActiveWorkbook
'Copy first sheet to this workbook
With ThisWorkbook
View 9 Replies
ADVERTISEMENT
Oct 13, 2009
I was wondering if someone could point me in the right direction. Firstly, I am using Excel 2007.
What I am trying to do is add to the bottom of a list/column of values. The value I want to add is a changing value which I have set to change once every minute.
For example, in cell A1 I have the value '2000' This value '2000' is placed into cell B1
Once the minute has elapsed, the value changes (by web capturing). This value could be anything. But I want this new value to be placed below the B1 cell, into B2.
Then, another minute passes, the cell A1 value could be different again and I want this new A1 cell value to be placed below the B2 entry, into B3.
View 9 Replies
View Related
Jan 17, 2010
I have a download of public records from a local County Auditor, regarding property ownership. However, the data, as it is provided is incomplete. I have obtained, from another source, much of the missing data and would like to append the original data.
I don't know if this is even possible, but in 'Googling' it, I am optimistic.
I have attached an Excel 2007 spreadsheet with a sample of the County data on Sheet1 and the data that I would like to append on Sheet2.
Sheet1 lists the parcel number (A), and information regarding the last five recorded sales.
B: Sale Date
C: Deed Type
D: Buyer Name
E: Recording Number
F: Sales Price
G: Multiple Parcels ("Y")
H: Notes
I: Loan Information.
Then the B-I information is repeated four times (J-Q, R-Y, Z-AG, and AH-AO or also defined as columns 10-17, 18-25, 26-33 and 34-41) for a total of the last five sales.
Sheet2 is a listing of sales with similar information.
A: Sale Date
B: Parcel Number
C: Buyer Name
D: Sales Price
E: Recording Number
F: Deed Type
G: Multiple Parcels ("Y")
H: Notes
I: Loan Information
What I hope to do is this:
If the 'Recording Number' (E) on Sheet2 matches the 'Recording Number' (E) on Sheet1, then replace the eight columns on Sheet1 with the data found on Sheet2 (pertaining to a specific sale number).
If the 'Recording Number' (E) on Sheet2 does not match any 'Recording Numbers' (E) on Sheet1, replicate the (unmatched) data (from Sheet2) on Sheet3.
My hope is that this will give me updated, and more complete, data on Sheet1 and also show me all the data that did not match on Sheet3 for me to use later.
I have included headers on both sheets in hope of making things clearer to the reader.
View 7 Replies
View Related
Oct 14, 2008
In order to transfer a column of data into a Crystal Report I need to add a comma (,) to the end of each cell in a range. These cells are all comprised of numeric characters, representing player card numbers.
View 4 Replies
View Related
Nov 8, 2011
Is there any way we can append the value of selected cells to make it 'value', Basically I need to add ' at the beggining and end of the a value in cells and a comma (,) at the end of it.
Example I have value 12345 in cell A1, When I run a macro by selecting cell A1, it should change it to '12345',
It should apply for all the slected range.
View 3 Replies
View Related
Oct 21, 2013
I have a large number of Excel files with unique filenames that contain information I would like to add as columns to the actual spread sheet.
SPY_P_20131025_172.00_XX
I am trying to in break apart the above format with each of the above underscore separated fields being placed in there own column. How I would accomplish something like this?
...And if I wanted to perform this function on a large batch of files is there a tool I would need to automate the process?
View 6 Replies
View Related
Jul 30, 2012
I have a folder containing text files. Any way by which I could merge all the text files into one file - one after another?
View 5 Replies
View Related
May 14, 2008
how to search for this so I'm just gonna ask. See sheet below I faked the resulting formula I need) for reference.
We have an engineering database that spits out data. One of the things it spits out is a list of equipment tags along with its associate electrical drivers (I.e. motors) and details for each. I need to do some extra playing around with the official equipment list that we have to produce.
In a nutshell, if an equipment tag only shows FIXED in any of it's drivers, I want the formula to show nothing (blank). However, if the word VARIABLE appears in any of that tag's drivers, I want it to show VARIABLE. I know there's a formula involving IFs and whatnot, I just can't figure it out.
******** ******************** ************************************************************************>Microsoft Excel - Book1___Running: xl2002 XP : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA1=ABCD1Equip TagDriver NameSpeed TypeFormula234-AG-900Primary DriverFIXED 334-AG-918Primary DriverFIXED 434-AG-932Primary DriverVARIABLEVARIABLE532-AG-931Primary DriverFIXED 632-AG-910Primary DriverFIXED 732-AG-911Primary DriverFIXEDVARIABLE8 2nd DriverVARIABLE 9 Tert Driver 1FIXED 10 Tert Driver 2FIXED 11 Tert Driver 3FIXED 1232-AG-916Primary DriverFIXED 13 2nd DriverFIXED 1432-AG-918Primary DriverFIXEDVARIABLE15 2nd DriverFIXED 16 Tert Driver 1VARIABLE 1732-AG-921Primary DriverVARIABLEVARIABLE1832-AG-922Primary DriverFIXED 1932-AG-923Primary DriverFIXED 2032-AG-924Primary DriverVARIABLEVARIABLESheet1 [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
View 9 Replies
View Related
May 7, 2006
I'm trying to create a spreadsheet that will automate our job bidding process. We have alot of standardized phrases we use and I thought it would be nice to just click on the phrases that are pertinent to the user's current bid. How do I get the user's current selection (from a form, not a cell) to append itself to the "current" end of the bid (a worksheet)? In other words, previously entered information by the user (name, address, type of bid, etc.) is already updated on the new worksheet created by the new bid, but how do I get the user's current selections to find the end of what is already there, and add itself to the bid at that point?
View 9 Replies
View Related
May 6, 2014
I have a workbook named as "DCR_Summary". In the sheet "FX", I want to get the sum of a specific column from two different workbooks named as "WNCR REPORT" and "DCCR-REPORT". The name of the column is "FXCOLL". The summation should start in row 7 all the way down where data is available. The good thing is that, my sum range will always starts at row 7 in both files but the bad thing is that the position of column "FXCOLL" is changing every day. The expected result is shown in the attached "DCR_Summary". It should pick at the same time the Sheet names where the summation came from. Sheet names is also changing and sometimes the FXCOLL is nil, hence, 0 value can be returned.
View 5 Replies
View Related
Feb 21, 2014
I've a workbook with two sheets 1)'weekly' and 2)'summary.'
Weekly is divided into products (up to a maximum of 8) with a fixed number of columns (4) directly below but a varying number of rows beneath as follows:
Product A (main header)
Issue|Serial Number|Analysis|Comments
data|data|data|data
data|data|data|data
data|data|data|data
data|data|data|data
--couple of blank rows--
Product B
Issue|Serial Number|Analysis|Comments
data|data|data|data
data|data|data|data
data|data|data|data
--couple of blank rows--
Product C
Issue|Serial Number|Analysis|Comments
data|data|data|data
data|data|data|data
data|data|data|data
data|data|data|data
data|data|data|data
data|data|data|data
..etc...
This weekly data must be appended into each product's respective grouping within the 'Summary' tab. With the following small additions: 2 additional columns filled with the model and current week must be inserted beforehand:
Product C
Model|week|Issue|Serial Number|Analysis|Comments
Product C|7|data|data|data|data
Product C|7|data|data|data|data
Product C|7|data|data|data|data
Product C|7|data|data|data|data
Product C|7|data|data|data|data
Product C|7|data|data|data|data
Summary page will contain the groupings of Product A through H. The weekly may only contain 1 (say Product D) in any given week, or all 8.
I realize there are more efficient ways of doing this, i.e. pivot tables, creating discrete tabs for each product, etc... but I've been tasked by the higher-ups to generate the above as I've laid out.
View 7 Replies
View Related
Aug 21, 2012
I have a folder containing 1000's of files. All the files end in .txt (for example test.txt) but are actually excel files. When I go to open the files with excel I get the following warning:
The file you are trying to open is in a different format than specified by the file's extension. Verify that the file is not corrupt and from a trusted source before opening the file. Do you want to continue?
I click "yes" and it opens fine as an excel file.
I want to merge all these files one after another into one file.
View 1 Replies
View Related
Jan 11, 2007
Can I Restrict Excel Data Form only for appending new record. (No deletion allowed) and also Can I save Data Form in the File? Is there any way, whenever we open the file Data Form should popup?
View 9 Replies
View Related
Feb 5, 2013
Copying data from multiple worksheets, but my problem is quite the reverse.
I have data for each month as a worksheet from 1970-2012. They are in a workbook with the recent years at first and the oldest years at the end/..
Like 2012Dec,2012Nov...............1970Feb,1970Jan
I would like to know how to write a macro to copy a range of data from Jan 1970 then add data from Feb 1970 and so on until Dec 2012.. The range remains the same throughout all the sheets.
I was able to do a rough code, but I am stuck doing the reverse part...
Code:
Sub ReverseList()
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
If Sht.Name "MEGA" Then
Sht.Select
Range("A:A").Insert
[Code] ..........
Also is it possible to restrict the range selection in each sheet based on the month and year?? For Ex. Accounting for leap year and 30 day months...
View 4 Replies
View Related
Jul 12, 2011
appending excel sheet number in a formula. Here is the example.
In an excel book, I have sheets 1 to 50. In each sheet i have a standard format to enter the details. And in one sheet I want to keep some summary with required cells. I made a table by applying formula, for example in cell A1 i kept formula ='9'!$D$9. In this '9' refers sheet9. In the similar way i want to capture the data from all sheets.
A1 cell ='9'!$D$9
A2 cell ='10'!$D$9
A3 cell ='11'!$D$9....etc
Is there any formula to append the Sheet number automatically (like dragging the shell) intead changing sheet number manually. because it is wasting so much time.
View 3 Replies
View Related
Mar 11, 2013
Macro for a repetitive task. I have data in every 3rd column (max of 11 columns) that I want to extract and append the data in column A in sheet 2. The data contains some blank cells and I'd like to remove them also.
I've attached an example in this workbook : tractdata.xlsx
View 4 Replies
View Related
Jan 3, 2008
I'm trying to move data from a primitive user form to another sheet acting as a DB. I will further pivot the data in a third sheet to boil up results.
Here is the primitive user form - or desired data from the user form: ...
View 9 Replies
View Related
Apr 24, 2014
I have a project where we need to write vba code for an IRR and Payback function.
View 13 Replies
View Related
Feb 2, 2009
I am trying to use a cut and paste within a macro.
I have code working fine if I do a copy and paste which is as follows:
View 5 Replies
View Related
Jan 10, 2008
Aggre ABC1Brand Sales 2A5 3B 2 4C7 5A1 6D1 7 8Above are my data 9 10Brand Sales 11A6 12B 2 13C7 14 15Above is the result I want. 16 17 Excel tables to the web >> Excel Jeanie HTML 4
View 9 Replies
View Related
Jun 14, 2008
The code instead of Vlookup that I'm using at the moment. It takes too long if you have 40,000 to 50,000 rows of data.
The data that I have is something like the sample bebow:
Col A from A1 to A15 with numbers like:
20000000
20000001
20000002
20000003
20000004
20000005
20000006
20000007
20000008
20000009
20000010
20000011
20000012
20000013
20000014
Col C from C1 to C10 with numbers like:
20000000
20000001..............................
View 9 Replies
View Related
Apr 20, 2009
I am trying to do is look at the first two digits of the number in column c (Range c5:c5000) if the number starts with 01 then I need the formula in column g = f5*12 if the number is 03 then I want the formula to be g=f5*24 I have several of these "cases" or "if" to put in can someone get me going a little further
Here is what someone gave me to work with but I'm having troubles getting it to work...I get a name error in the cell and I cant use this they way it is because the code needs to go into the sheet mod with a bunch of other code.Also when I use the Option Explicit the rest of my code wont work.
Option Explicit
Function re(Cl As Range, Src As Range)
Dim i As Long
Select Case Left(Cl, 2)
Case "01": i = 12
Case "03": i = 24
End Select
re = Src * i
End Function
=re(C5,F5)
View 9 Replies
View Related
Jul 15, 2006
I am trying to use a dynamic range in VBA. But I am getting compile error.
Range("D19:G19").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("D19").Offset(0, 0, _
Application.WorksheetFunction. CountA( activesheet.name!Master)) , 3)
In the above code Master is a dyanmic range. I need to autofill the copied data in the 3 coloumns.
View 3 Replies
View Related
Dec 5, 2008
I have an Excel sheet with a few thousand rows which I would like to filter by a column with the name TrackingID. This column contains values like:
12AA1
23452BA2
234AA1
345635CA2
...
I would like to filter this column by the third character from the end (which is always a letter from the range [A-Z]). In the example above, this would be:
A
B
A
C...................
View 2 Replies
View Related
Apr 11, 2012
I am writing some code where one column is selected and a value is searched for in that column. If found the code continues on its way manipulating the data. The issue is that the value being searched for will not always be there which results in an error. Is there a way that I can just tell the macro to continue running if the value is not found.
Columns("V:V").Select
Selection.Find(What:="1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Rows(ActiveCell.Row).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
On a second question is there some code I could write that would select all the rows with the number 1 in column V and delete them rather than doing the way I am here?
View 9 Replies
View Related
Apr 16, 2014
I've been trying to put together a function in excel which will make it simpler and a bit clearer to produce the coefficients of trend lines in cells. I want to produce an excel function like SLOPE and INTERCEPT but for exponential, power and logarithmic trendlines. For example, I can produce the coefficients for an exponential trendline like this:
Code:
=SLOPE(LN(K2:K11);J2:J11)
=EXP(INTERCEPT(LN(K2:K11);J2:J11))
Ideally, I want to be able to do so without the need to convert the terms with LN function, and be able to replace it with a new function that deals directly with an X Range and a Y range
I've produced the following code:
Code:
Function PowerSlope(YRange As Range, XRange As Range)
For Loops = 1 To YRange.Count
YRange.Value2(Loops, 1) = Log(YRange.Value2(Loops, 1))
Next Loops
PowerSlope = Application.WorksheetFunction.Slope(YRange, XRange)
End Function
However, this causes Excel to crash and shut down (not the macro itself, but the entire program). I can't even get the function to run to a break point in the first line before the crash happens. I'm able to remove the FOR ... NEXT loop and use the function to directly return the result of the linear slope, so I'm confident the issue is not in that part of the code.
View 4 Replies
View Related
Mar 5, 2010
I have values that I want to color code in my table. Originally I was tagging them as numbers, but instead I need them as colors.
Function conversion(pVal As Double)
If pVal > 0.05 Then
conversion = "1"
ElseIf pVal > 0.001 Then
conversion = "2"
ElseIf pVal > 0.0001 Then
conversion = "3"
ElseIf pVal > 0.00001 Then
conversion = "4"
End If
End Function
Now I want instead of conversion = "1" etc to be
Function conversion(pVal As Double)
If pVal > 0.05 Then
(make white)
ElseIf pVal > 0.001 Then
(make brighter blue)
ElseIf pVal > 0.0001 Then
(make green)
ElseIf pVal > 0.00001 Then
(make navy blue)
End If
End Function
I want the text and cell the same color (number and cell so the number disappears so that I just have a colored cell but the value is still there if I want to look at it).
View 9 Replies
View Related
Apr 24, 2009
I am trying to write a function in excel to use the worksheet function "small" In the vba immediate window it doesn't return anything and in the spreadshhet I get a # NAME? error when called in a cell the code is below.
Sub UseFunction()
Dim myRange As Range
Dim answer As Integer
Set myRange = Worksheets("Sheet1").Range("A1:F6")
answer = Application.WorksheetFunction.Small((myRange), 1)
MsgBox answer
End Sub
View 3 Replies
View Related
Jul 12, 2006
Whilst stepping through code in any new sub/ function that I create in VBA, VBA Editor (seemingly arbitrarily) jumps to a line in a completely different function.
View 4 Replies
View Related
Mar 18, 2008
Is it possible to Call the inbuilt Excel Functions (like VLOOKUP) in Macros. we have to pouplate cells with formula which uses VLOOKUP. one way was to update each cell with required Formula like: [code] Range("A1").value = " = 6*F7*(1-Vlookup(lookupvalue........))"[code] but this was stupid as no of cell to be populated was large and variable and moreover it will return formulae to cells rather than fixed value. What we tried was to defile an table_array as Array(x y) and then use this array to return required VLOOKUP value. However I was thinking is there any way to call function like VLOOKUP in Macros so that we can return a value to cell rather than formula.
View 3 Replies
View Related