February 4, 2014, 3:14 pm
Hi,
I have about 400 images of QR codes with peoples emails in the QR codes and i need to import them all into an excel sheet with a certain spacing between them and with the file names (persons name) above each individual QR code. Is this possible?
Thanks for your help.
↧
February 4, 2014, 3:32 pm
Hi,
I have two sheets of data , sheet A and Sheet B.
Sheet B contains a column called "Name" and for each name, and for each name there are corresponding numbers. In sheet A, I have a "list of interest" in column A. What i want to do look through the data in sheetB to find a match from the list of interest and return the corresponding letters, located in column A.
I have filled out the first two rows of results that should be returned as an example.
One idea i had was to put a vlookup formula in each column result 1 to result 6 so i can catch all 6 "Serves" columns from column B, but there may be duplicates in the serve columns and vlookup only reports the first match.
Thanks in advance
↧
↧
February 4, 2014, 3:40 pm
I have a chart that contains several series of data that are organized under the same columns. For example, Series1 = (C3:C9,G3:G9), Series2 = (C10:C16,G10:G16), etc. I want to use a macro that automatically adds custom error bars whose positive and negative ranges are one column to the right of the series Y-data, e.g. H3:H9 for Series1. Below is my attempt at the code but I have difficulty defining the error bar range (see Line 6). I would like the macro to add error bars to all series in the chart. Anybody have suggestions?
Code:
Sub ErrorBars()
Dim txt As String, srsYval As String, i As Long, srs As Series, errRng As Range
For i = 1 To ActiveChart.SeriesCollection.Count
txt = ActiveChart.SeriesCollection(i).Formula
srsYval = Split(txt, ",")(2)
Set errRng = Range(srsYval).Offset(0, 1)
ActiveChart.SeriesCollection(i).Select
ActiveChart.SeriesCollection(i).HasErrorBars = True
ActiveChart.SeriesCollection(i).ErrorBars.Select
ActiveChart.SeriesCollection(i).errorbar Direction:=xlY, Include:=xlBoth, _
Type:=xlCustom, Amount:=errRng
ActiveChart.SeriesCollection(i).ErrorBars.Select
Next
End Sub
↧
February 4, 2014, 3:53 pm
I am trying to create a Macro for taking information from a master sheet "sheet1" and dumping it into another worksheet based on a single variable in "sheet1". I have attached the excel workbook for reference. In detail, I would like to pull all of the rows where cell "F" in "sheet1" equals "1" and dump them into the new sheet titled "Dept1" with the same headings. The same for all rows where cell "F" in "sheet1" equals "2" to dump into the new sheet titled "Dept2".
Big thank you in advance.
↧
February 4, 2014, 4:05 pm
Hey Guys,
So I found and used the following code before and it worked fine. Today I deleted a tab with that had a Pivot on it, but this vba is not specific...so I'm a little confused.
Any help?
Code:
Sub RefreshAllPivotTables()
Dim PT As PivotTable
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
For Each PT In WS.PivotTables
PT.RefreshTable
Next PT
Next WS
End Sub
↧
↧
February 5, 2014, 12:39 pm
Can anyone help me with this.
Please look at the workbook attached. What I need the command button on worksheet 'SLA Order' to do is the following:
Copy only rows with data in them from columns A:C and paste them into the worksheet 'Totals'
If I add more rows of data in the worksheet 'SLA Order' and hit the command button it will again copy only rows with data in them from columns A:C and paste them into the worksheet 'Totals' but it must copy it must paste them directly below the previous pasted cells
i.e. there are 2 line of data. I hit the command button and then add 3 lines of data to the 2 lines of data and hit the command button. There should now be 7 lines of data in the the Totals worksheet with no gaps
Also I have created a named range of the area from which I wish to copy called Order
Does this make any sense
Please Help.. I'm really struggling with this one
↧
February 5, 2014, 12:44 pm
So I have been working on a project that utilizes a pivtot table with monthly data in it to do and display all sorts of other things... Those macros, for the most part, function ok.
I am at the stage where I'm now trying to set up a system so that come the beginning of the new month, the updated data can be imported from the new spreadsheet painlessly.
I have a macro that clears the old data and pastes the new stuff in its place. Now a problem here is that the number of rows will change month to month (columns will be 100% identical) and I need to adjust the pivot table source range accordingly.
I can count up to the last row of data and get an integer telling me what row is the last one, but I don't know how to pass that to change the data range of the pivot table.
Any ideas on a method?
↧
February 5, 2014, 1:18 pm
I am trying to create 1 workbook to track design changes. Basically I have separate sheet tabs (example: change 1, change 2, etc.) in the Excel workbook. I want to have the 1st sheet in the workbook be a log that will pull information from all the other sheet tabs and list it. The sheets I am pulling information off of are all formatted the same. There will be columns on the summary sheet listing number, originator, description, etc. When I create a sheet tab the next row in the summary sheet will pull information from the same cells on the new tab as the previous tab and add it to the end of the list. Make sense? I have watched several videos but most of those take info from across tabs and summarize.
↧
February 5, 2014, 1:36 pm
I have a spreadsheet which has a userform that opens up upon opening the spreadsheet if it is a new project. When i get ready to send it to others, i check the lock project for viewing box in the vba editor and give it a password. I then close the file and open it up. I get a runtime error 7 can not find specified object every time when the locked project box is checked. It will stop on the frmOpen.show line. Stepping through or even clicking run on this line, will allow the code to complete without incident and the form to open like it is supposed to without error.
If i uncheck the lock project for viewing box, save, close and reopen the file, it runs without a problem.
I have gone through the initializing code for the form and can not find any apparent errors such as referencing missing controls etc.
Any suggestion is welcome.
Thanks,
Jim
↧
↧
February 5, 2014, 1:45 pm
Guys,
I have never used VBA & Macros before professionally before, but I think I do need to learn them now. I have been given a spreadsheet which have various financial values all of them are UK stocks currently.
I want to add Current share price of those stocks automatically either from Yahoo Finance or any other reliable source.
Is there any simple way of adding that so whenever I open that sheet the stock price is already updated?
Thank you in advance.
Kash
↧
February 5, 2014, 1:57 pm
Hi all,
I have a excel VBA script that basically iterates through links within a web page, opens up each link, within that new window, tests the links in there for 404 broken links. This script works fine when I initialize with ie10, but crashes with ie11 at the end of a for each loop.
The browser crashes at the end of my for each loop (last element within ielinks_inner_only) and restarts automatically the browser so that I can't even do ie2.quit showing a popup that says "An unexpected error has occurred".
Code:
Set ielinks_inner_only = IE2.Document.querySelectorAll("div.ps-footnotes a")
For Each links_inner In ielinks_inner_only
If links_inner.className = "navigationLink" Then
linkstocheck = links_inner.href
LastRow2 = Worksheets(1).UsedRange.Rows.Count
Worksheets(1).Hyperlinks.Add Range("A" & LastRow2 + 1), linkstocheck
If (GetResult(linkstocheck)) Then
Worksheets(1).Range("B" & LastRow2 + 1).Value = "Good"
Else
Worksheets(1).Range("B" & LastRow2 + 1).Value = "Bad"
End If
End If
Next links_inner
Does anyone know what is causing this problem or have any insight? Again to reiterate - this is specific to IE11, and no such errors exist in IE10; however, I need it to work for IE11.
Thanks all for your time in advanced!
Jason
↧
February 5, 2014, 2:09 pm
Hello All,
I'm working on a sheet that I set up a Macros on to auto convert to PDF. The issue I'm having is that it wont print all the columns I need.
I can do it in acrobat, and I can physically print all the columns, but the auto creat wont work.
Below is what I'm using
Code:
Sub ExcelToPDF()
Dim iPtr As Long
Dim sFileName As String
iPtr = InStrRev(ActiveWorkbook.FullName, ".")
If iPtr = 0 Then
sFileName = ActiveWorkbook.FullName & ".pdf"
Else
sFileName = Left(ActiveWorkbook.FullName, iPtr - 1) & ".pdf"
End If
sFileName = Application.GetSaveAsFilename(InitialFileName:=sFileName, FileFilter:="PDF Files (*.pdf), *.pdf")
If sFileName = "False" Then Exit Sub
Sheets(1).ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFileName, Quality:=xlQualityStandard, openAfterPublish:=True
End Sub
↧
February 5, 2014, 2:10 pm
Hello,
I am trying to figure out if it is possible to write excel macro that would do the following on the example range listed below (this will have to be applied on a much greater and dynamic range later):
1. the main goal is to color all rows where a country has assigned more than one first name
2. rows where there is no value in column in the second column should be ignored
1 2
Poland Mark
Poland Mark
Poland Jack
Germany
Germany Mike
Germany Mike
Germany Simon
Russia Peter
Russia Peter
Russia Bob
Turkey Ece
Turkey Ece
In this case the following rows would be color coded:
1 2
Poland Mark
Poland Mark
Poland Jack
Germany Mike
Germany Mike
Germany Simon
Russia Peter
Russia Peter
Russia Bob
Rows that would not be colored:
1 2
Germany
Turkey Ece
Turkey Ece
Please let me know if that is possible at all. Any ideas where to start would be appreciated.
↧
↧
February 5, 2014, 2:10 pm
hi
I've found various threads showing how to hide/unhide rows based on a value in a cell and built a form based on the code I have found. The form has three uses and shows hides sections (rows) of the form dependant on the option selected in a cell (B1) This works fine but I now have a requirement for users of this form to add addtional rows into some of the sections but as they do this sections further down the form move down so subsequent sections then have different row numbers to that in the VB. I thought that I could use named ranges instead of row numbers but as soon as I put in the named range I get runtime 13 mismatch error?
Please help.
The attached sample has a drop down in cell B1 for options A, B or C and dependant on this selection, groups of rows are hidden.
Each grouping of rows already has a named ranges (Range1 to Range5) but how do I use these in the VB?
Many thanks
Stuart
↧
February 5, 2014, 2:38 pm
Hello.
I'm a rookie to macros/VBA and to this website/forum. I appreciate any help I can get on my question (a rookie question).
I'm slogging my way through a macro that essentially copies specific (but non-continuous) columns of raw data from one worksheet ("data") to another worksheet ("fundings"). Both worksheets are in the same workbook. The code I listed below works (albeit, it is ugly), but I'm having a hard time pasting my data differently than how I'm copying it. What I need to do is paste the data into specific (non-continuous) columns on the destination worksheet. I'm using the Union function to copy the non-continuous columns from the raw data. This function combines the non-continuous columns and makes them look continuous. There are nine columns selected in "data" (see code below), and this data is then pasted to the first nine columns in "fundings". What I need to do is paste the results in specific columns of the destination worksheet ("fundings"). For example, I want the first-through-fourth copied columns ("A-D") to paste to the first four columns of the destination sheet (this already happens), and I want the fifth column of copied data ("G") to paste to the seventh column of the destination sheet (not working). I can't figure out how to skip columns in the pasting function.
Apologies for being lengthy. And thanks in advance for the help.
Code:
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
Dim LDateToday As Date
Dim DestinationSheetName As String
Dim Fundings As String
Dim CopyToRow As Integer
'Macro is run based on the date that is listed on the "Company Statistics" tab.
LDateToday = Sheets("Company Statistics").Range("D1").Value
'Set the tab to where the data will be imported (from the "data" tab).
'Make sure to change this number if the "destination" row changes.
CopyToRowFundings = 13
'Select the row from which the macro starts searching for the relevant data (in the "data" tab).
LSearchRow = 2
'Select the worksheet from which the macro will pull the data (pulling from the "data" tab).
Sheets("Data").Select
'Only reference data in the respective column/row if there is a relevant data set available (e.g., refer to a code ID).
While Len(Range("A" & CStr(LSearchRow)).Value) > 0
'Set constraints to limit the amount of data searched by the macro.
'Refer to two tests for this function: a) the funding date compared to the relevant date, and b) the funding column has available data.
If (Range("U" & CStr(LSearchRow)).Value) < LDateToday And (Range("U" & CStr(LSearchRow)).Value) > 0 Then
'Select the specific columns on the data sheet to copy.
'Important to note that the first range covers columns A-D and the balance are individual columns.
Union(Range("A" & CStr(LSearchRow), "D" & CStr(LSearchRow)), Range("G" & CStr(LSearchRow)), Range("J" & CStr(LSearchRow)), Range("U" & CStr(LSearchRow)), Range("Y" & CStr(LSearchRow)), Range("AI" & CStr(LSearchRow))).Select
'Copy the specific columns as a continuous set of numbers, as if the columns were immediately next to each other (which explains the Union).
Selection.Copy
'Set the rules for matching the above data to the destination worksheet.
'The "+1" feature creates the loop.
'The "DestinationSheetName" feature points the data to the correct worksheet.
'Now we have copied the data, pointed it to the correct destination.
CopyToRow = CopyToRowFundings
CopyToRowFundings = CopyToRowFundings + 1
DestinationSheetName = "Fundings"
'Now tell the macro how to paste the data to its destination.
Sheets(DestinationSheetName).Select
Rows(CStr(CopyToRow) & ":" & CStr(CopyToRow)).Select
ActiveSheet.Paste
↧
February 5, 2014, 2:53 pm
I have a spreadsheet which imports data files, and each file has a cell that has the word "Sample" .
I would like VBA code to find and replace each instance of the word "Sample" with the 'Title1', then 'Title2', then 'Title3' etc.
I was working with the code below to try add sequence numbers, but it's not quite working right, and I know the answer is simple.
Any help would be awesome.
Sub Numbers()
Dim ged As Variant
Dim b As Range
ged = "Sample"
For Each b In ActiveSheet.Range("A1:A")
k = 1
i = k + 1
If b.Value = ged _
Then b.Value = "Title" & i + 1
Next b
End Sub
↧
February 5, 2014, 3:13 pm
Greetings all!
Excel 2010.
I would like my macro to autofilter a table based on a small list of part numbers. The small list (Table?) would be elsewhere in the same worksheet but on a different tab.
Currently, I've hard-coded the part numbers. But they will change in the future and I want the User to be self-sufficient and maintain a seperate list that the macro would use for the autofilter.
How can I do this?
Current Code:
Code:
With ActiveSheet
ActiveSheet.ListObjects("raw_Table").Range.AutoFilter Field:=3, Criteria1:= _
Array("Part1", "Part2", "Part76"), Operator:= _
xlFilterValues
What I want:
Code:
With ActiveSheet
ActiveSheet.ListObjects("raw_Table").Range.AutoFilter Field:=3, Criteria1:= _
Array("Some gee whiz dynamic list!"),Operator:= _
xlFilterValues
... please help tell me what the "Some gee whiz dynamic list" would be!
Thank you for considering my problem.
↧
↧
February 5, 2014, 3:20 pm
hey guys so i have a macro that goes through opens workbook, copies data, closes book, pastes data to main book then moves to another spreadsheet, however it doesnt copy the data because i close the book after i copy and it isnt saving data to clipboard because i have Application.DisplayAlerts = false as i dont want to save the book however i need to keep the data copied to clipboard.
How can i automatically say yes keep data to clipboard?
↧
February 5, 2014, 3:23 pm
Hi all, I need to activate a window based on a date format and a name.
The codde I used doesn't work in excel 2010, but does in excel 2007?
[CODE]Windows("name" & Format(Date, "ddmm")).Activate[CODE\]
I Need to have it work on both 2007 and 2010. Any help will be great
↧
February 5, 2014, 3:27 pm
i have created a catalog with an invoice, sheet 1 is my invoice and sheet 2-36 are the different categories. I need to transfer data from sheet 2 to sheet 1 Containing QTY, Item, Item ID and Price. from my understanding here is what is needed to start the transfer from sheet 2 to sheet 1....
sheet 2 (catalog)
A -- B -- J -- M
QtY -- Title -- Item ID -- Price
sheet 1 (invoice)
A -- B -- E -- F
QTY -- Title -- Item ID -- Price
I highly appreciate any help to set up the codes.
Thank you
↧