I have been working with Excel, access and vba from 4 years. But never worked with PDF files along with vba.
Now I have a requirement to write data from excel to pdf. I know about using Acrobat distiller to create Post Script file and then converting into pdf files.
But I wanted to know if there is any way to write data directly into PDF from excel using VBA.
Currently I work on a file which will be more like a form which will be filled by user and after he or she hits the button, the filled data will be written or sent to another Excel file or even Sheet in the same workbook which will store the filled data in database like form. The same as some web form which will post the data to database.
In other words, the workbook contains to sheets, one with forms to be filled in (cells) and one with specified columns. After filling in the cells on the first sheet and hitting the button, it will trigger the macro which will send data to second sheet and post data from each cell to appropriate column.
I have 6 columns. The 5th and 6th columns are the most important. The 5th contains a figure and the 6th contains a type.
Bascially I am trying to do a basic chart showing the following 2 things. A. Do a percentage chart of column 6 (service) but not of percentage of hoem many lines the product is in. Not based on percentage of how many times Apples are shown compared to other products. I need it to add up everything, then do a percentage of total amounts of oranges and total of for Apples from the figures on column 5. Also, if possible, the pie chart will even show teh actual total figure per product in each (or next to) each pie chart slice.
know the easiest way to do this (step by step) in Excel 2010 and then I can perhaps write a macro for the future?
How I can directly write info from an external application to an Excel sheet
Actually, I'm using a special dll collection to do it, but I would need to buy the 64 version soon. Problem is I use only one function of the entire collection so I want to look on how to create it my self. Basically, it took data from my charting software and write directly to my Excel Worksheet.Cell
Background: The user makes a selection from a drop down box on the main sheet (sheet5, G12). The drop-down box is linked to *Sheet31.Pax_Nav*. If the drop-down box's linked cell value is less than 5, then do nothing (manual input required). If it is greater than 5, then the vlookup matches that number to a person in the database and returns their weight. The code will pull the required person's weight but then Excel will hang and freeze.
Private Sub Worksheet_Calculate() On Error Resume Next If Sheet31.Range("Pax_Nav") > 5 Then Sheet5.Range("G12").Value = Application.WorksheetFunction.VLookup(Sheet31.Range("Pax_Nav").Value, Sheet31.Range("H17:L48"), 5, False) Else End If End Sub
On one of our computers at work, Excel is acting especially strange. The conditional formatting in Excel on one of our computers is not working. In addition, we cannot fill a cell with any color or change the color of the writing. We can click a color for the letters and type it in, but immediately after another cell is highlighted, the writing goes black again. When we try to highlight multiple cells with the cursor, the cells are black instead of the normal color. This happens to not just spreadsheets that are new, but existing spreadsheets on our shared drive from only this one computer as well. No other computers are affected this way. All other computers show the spreadsheets fine and do not have any functionality issues.
In a userform I have 2 combobox, a textbox and a checkbox. In Checbox1 have data in A2: A550 and checkbox2 have data in B1: B50. I want the number entered in textbox1 to be written - by pressing the SAVE button - to the intersection data of combobox 1 and 2 and once written to can not be rewritten. Therefore, if you enter a wrong number, it will check that checkbox and where to enter the cell number, to be colored in red.
i want to import data from sheet2 a1 from sheet1 a1 continously. now problem is when iam importing i shouldnt loose my previous data. eg: at time 11 when i import data to sheet2 a1 from sheet1 a1 with value 9. and at time 12 when i import data to sheet2 a1 from sheet1 a1 with value 10. value 10 will be over wrting value 9. here i shouldnt loose value 9. i want values comming afterwards should come to next row.
As part of a research project i need to extract as much data as possible from a webpage. The problem is to access each table i have to follow lots of links which I can't get to work automatically.
Its from a greyhound-data.com. So an example would be I want to extract all the racing stats for every dog that raced in swindon between 1st jan 2010-1st feb 2010. When i put it in the search engine I get 512 races in a table. I have to follow the link on name of race for each race.. Then I have to follow the link for each dog in the racers box, 6 for each race. Then when i'm on the dogs page theres a link saying on the top of the page saying a nember of races eg. 67races (number will vary for each dog). If I press that I get a list of all the racing stats for that dog. Its that table i need. But i also need the dogs name as a constant column. I need the table for each of the 6 dogs for each race out of the 512.. So in total 3072 tables.. It a lot of data and I have no idea how to get it?!
My biggest problem is I don't know how to say follow the various links. And I don't know how to loop multiple times - once for each of the races in the original list and then for the 6 dogs.
i want to searh from data sheet by writing a formule to black area.
We will write id number to yellow area.
When we write value to yellow area, the formule in black are will look column of " d ".
If it is " machinery" or " with lifting point " , the formule will search only according to id number.
If it is " lifting gear ", the formule will search according to id number and capacity simultaneously. And the value will be come up in black area from column of "a".
If there is no id number in data sheet, " no certificate no" will come up im black area.
I have a worksheet that contains two basic columns of data, A and B. What I would like to do is based on the value in column A, I would like to copy the contents of column B to a textfile (preserving the basic line structure and hopefully without any extra characters like quotation marks attached). So for all the values in column A = 'Account', Id like to take all the corresponding values in Column E (for example) and save them to the same file, preferably where the filename itself as 'Account.xyz'. And I would like to do this for all unique values in Column A, that is do it for 'Account' and 'AccountPrivilege' etc. Note Column A is essentially presorted alphabetically already. There are actually 1000s of rows with hundreds of unique A values so Id like to find a way to automate this process.
I have a table in which some of the ranges have to be set to "0" (write "0" inside, not delete) when I click on a button. All the other cells expect these ranges are locked. For now I use the very long way, with the following VBA Code:
There are more columns for which I have to do that, and it goes until row 500+ .. I used "Register Macro" to find out this code, that's why I guess it's obselete.
Is there any way I can do it, at least write all the ranges I have to fill with "0" next to each other instead of every time selecting, then inserting 0, then autofill the rang with...?
I have a list of items in a pivot table where each item has a date. I want to see how many items occur for each month. I am trying to use the COUNTIF formula, but I'm having trouble figuring out how to write the criteria for the dates.
How do I write the criteria part to include the entire month?
i have an report in which i need to delete the entire row if the column contains values more than 250K, but the chanllenge here is; if any of the cells in the column contains a formula then the macro should not delete the row.....
if I have another instance of word open my macro will not work correctly. I am at a loss on how to figure this out. Also some times I get the error of virtual machine is not available when getting activedocument.name.
Sub TestTemp() Application.ScreenUpdating = False
Dim bname as string
bname = Range("B6").Value
Dim WdApp As Object, WdDoc As Object Set WdApp = CreateObject("Word.Application") WdApp.Documents.Add "C:TemplatesTest Letter1.dot" Application.Visible = True WdApp.Visible = True
in writing a subroutine that needs to ask the user
1) tax file number 2) Income 3) tax withheld
It then needs to use a function that i already made called 'incometax' that calculates 'taxpayable' and use that to calculate taxreturn (difference between 'taxpayable' and 'taxwithheld').
I then need it to output like this in a message box
Estimate for tax file number: ..... Created on ...... Total income: ...... Tax witheld: ....... Tax payable: ......Tax return: .......
The following code is supposed to write values from one file into another file - depending on the value of Current_Rider_Name. However, although the code runs and values are being picked up (this is checked through the line that is being commented out).
However nothing is being written to the file. Can anybody point me in the right direction? ...
I am trying to write a UDF that will go like this:
IF A1 is Purple then B1=A1 Else B1=A2.
This is what I have written so far and I cannot figure out how to get it to work:
Function SumIfPurple( Range As Variant, Range1, Range2) Dim SumAnswer If Range.Interior.ColorIndex = 39 Then Range1 = SumAnswer Else: Range2 = SumAnswer End If SumIfPurple = SumAnswer
I have a problem, basically im writing in the cell but it keep going along, i want it so when i press enter it creates a new line in the cell, so i can have two lines of text in one cell. do i have to do something in the text settings?
I have Asset Class in Column I and if it is 364A-EL or 365A-EL or 368A-EL or 368B-EL or 369A-EL or 371A-EL or 371B-EL or 373A-EL or 397C-EL then 'POLES' assigned in to Owner Class (Column J).
If Asset Class is 366A-EL or 367A-EL or 367B-EL or 368C-EL or 369B-EL or 371C-EL or 373B-EL then assign UGCBL to Owner Class.
Should we write the macro or can it be accomplished by any Excel Function?
I'm working on creating an array of letters. I'm then writing that array into a cell. The following code is for writing the letters "ABC" into a cell with an array.
I run the macro on a currently open workbook (name could be anything) and open another workbook (name known) and step through the sheets copying various blocks of data across to the first workbook. I need to Activate the 2 workbooks alternatively as I move data back and forth and move from sheet to sheet. What I can't work out is how to determine in code what the "unknown" workbook name is so that I can make sure I activate the right workbook in the code.
I tried Activating the workbook with the "unknown" name and setting a variable = ActiveWorkbook.Name. However the value of this variable changes during the code run when you activate the other book. Is there any way to collect this value and "freeze" it so it won't change as the code runs? At the moment I have got round it by ensuring the "unknown" book is the only one open before I start and refer to it as Workbooks(1) in the code.
i've a macro which will read the data from worksheets and copies that data and paste the copied data into new workbook sheets.
it is copying the data into new work sheet. whats my problem is my original application contains formatted data like having cloros and some of the columns having big font size etc and some of sheets contains merged cells.
i'm totally having 8 worksheets with different layouts and the macro copying the data into 8 new worksheets but the look and feel is not similar to the original application. But i want as it is.
I have an single dimension array called "Test". I have a range of one column called "Vol8_P1". Both are 1200 in size. I want to write the array to the sheet.
This code works:
i = 1 For Each c In [Vol8_P1] c.Value = Test(i) i = i + 1 Next c
But this code give me all zeroes:
Dim Destination As Range Set Destination = Range("Vol8_P1") Destination.Value = Test
I tried resizing "Destination" in the second code piece and that did not work.
A macro in workbook 1 creates a report by reading & manipulating data from two workbooks(WB 1 and WB 2).
A new blank report sheet is copied from WB1 to WB2. The data (some text, some numeric) is collected in a 20 element, single dimension array & written to the new sheet in 20 columns using a for/next loop. This is repeated for many rows(can be more than 1000).
The array is "erased" before each row. Screenupdating is turned off, calculation is turned off. The report takes longer & longer each time it is run - Why? With the one-and-only "Write" line "remmed out" the report takes just 2 secs however many times it is re-run - including the copying of the blank master report page. If the first report takes, say, 1 min the second time takes 2 mins & the 3rd - 3 mins etc. Reset is only achieved by exiting excel. The code in question is:- For col = 1 to 20 : cells(ro,col) = d(col) : Next col. (ro = the current row number which is incremented for each pass, d() is the data array)