excel 07 vba code

  1. I

    Consolidating Data from different worksheets

    Can some please assist me with the following: I've tried a bunch of code which has somewhat helped but can't seem to get what I'm looking for. Note: Each Row specified is Actually its own sheet with the same header. Sheet1, Sheet2, Sheet3, Sheet4, & Sheet5 Expected Outcome: Name -...
  2. J

    Macro for importing data from one excel book to another excel book...

    Hi Friends.... Please guide.... 1) I have two excel book "Book-1" and "Book-2"... 2) Book-1/Sheet-1 contains a table of six column and 100 rows with specific data mainly text.... 3) I wish to import that table in "Book-2 / Sheet-1" as a normal table using a command button... Thanks in advance.....
  3. A

    Convert simple formulas into vba code for range cells

    Hi friends, I have to convert formula into vba code for a range cell for Eg:formula for a single cell Say C2 = LEFT(L2,FIND(" ",L2,1)-1); I want to put this formula into vba code for range cells say C2:C I know this Is Simple but I'm very new to this! Any Help Thanks in Advance......
  4. A

    Simple If Else in vba program Had Method Range Global failed error

    Sub Nationality() Dim rng As Range Dim cell As Variant lRow = Range("R" & Rows.Count).End(xlUp).Row Set rng = Range("R2:R500" & lRow) For Each cell In rng If Cells(i, "R").Value <> "UK" Then Cells(i, "R").Interior.ColorIndex = 3 End If Next I'm New to excel vba, It seems to be simple...
  5. I

    how to disable the menu key (context key)keyboard using excel Visual Basic

    i trying to protect my excel workbook so no one can copy or edit my work,i have successfully disable all main sources of copying my work such as,"right click" on the mouse is disabled and "save as" is also disabled. "ctrl+c" also disabled,but I've notice that when i click the menu key( context...
  6. M

    Compare values from differnt worksheets and write in adjacent cells

    Hello! I am new to programming in excel but am looking to make a VBA that allows me to see if a value entered exists in a second spread sheet. If it does then write a comment next to it. If not then write a different comment. This is what my spread sheet currently looks like: Sheet1 contains...
  7. C

    How to locate a specific Tag whose position is not same in each excel files and read the measured value column for that specific tag

    <tbody> I have multiple Excel files for a particular part number which I have narrowed down to few 100s by my search macro, but in those found files my search also needs to look for a particular <code>id tag</code>. Let me explain it, each Excel file having name as part number has information...
  8. C

    VBA - Copy and paste entire row to second sheet based on cell value

    Hello, Today I finally taught myself a basic understanding of macros/VBA. I've made a lot of progress on my project, but am stuck at the moment...Here's what's going on: I have a sheet titled "All Trades" that contains the raw data like the example below. I have two other sheets titled "As-Of...
  9. P

    macro to delete rows between named ranges in excel

    How do I delete all rows between named ranges? I have a scenario below Name Range 1 : SUBHEADER_001 (A1:E1). Displays Headers Name Range 2 : SUBFOOTER_001 (A40:E40). Displays legends and dates. Between these ranges I am inserting data from sql server. The cell ranges of the...
  10. B

    VBA coding - SET RNG

    Hi All, I am trying to have my VBA code grab all the information in the relevant range, but not pick up any empty lines, i.e stop when there is no more information. This is the code I have right now. Set rng = Nothing Set rng = Range("B5:H31").SpecialCells(xlCellTypeVisible) So say my...
  11. N

    Need macro to sequentially populate worksheet from other worksheet + save as .pdf (Excel 2007)

    Hello Forum: I am just getting started with macros, could not make this work, and would greatly appreciate your help and expertise. The task we are trying to execute is essentially populating a chart (Sheet 1) repeatedly with data from sequential rows in a table (Sheet 2), and saving each...
  12. cvincent

    VBA Error Code Type Mismatch

    The following runs fine, however my Excel file is displaying Run-time error 13: Type mismatch. Not sure what that means. Can someone please tell me how to correct this? Thank you. Sub OpenWordDoc() Application.DisplayAlerts = False Dim wordApp As Object Dim wordDoc As Object...
  13. cvincent

    Excel 2007 VBA to Merge Selected Data into Word Merge Form

    I am attempting to utilize data from my Excel file to merge into a Word form. Users can use search buttons to filter selected data, which is then copied to a tab entitled "Selected Contacts". I can then run a macro that opens my Word 2007 merge document, but I am unable to create the code to...
  14. andreroux

    My couters are not recognized in IF STATEMENT

    Hi All I have a macro with 3 counters: STRT_NM1, START_ROW, COUNTER. I run a For...Next loop to execute a sub macro called DoWork. At the end of the DoWork Sub Macro, I display my counters to see if they are incremented, and they are incremented as I expect. Yet, In an IF statement, I want to...
  15. F

    createing a running sum in VBA

    Bonjour, Ihave beeen struggling on this for way too long, I'm trying to create a running total. fist the macro starts by inserting a column and calls its first cell Incremental cost, then the cell bellow is set to be equal to the adjacent cell, the one below is equal the sum of the one above...
  16. V

    How to concatenate formula and string characters using function code

    Hi, I have written a function code to concatenate strings and formula, which is failing after so many attempts. Function CAT_SUM(a As Integer, b As Integer) CAT_SUM = a - b If CAT_SUM.Value < 0 Then ActiveCell = "the percentage has decreased by " & CAT_SUM & "" Else ActiveCell = "the...
  17. G

    GetFile DateLastModified not working correctly

    Hi everyone, I am having an issue with the following code, which is intended to retrieve the file's last modification date (I'm only showing the most relevant lines for the sake of brevity): Set oFS = CreateObject("Scripting.FileSystemObject") Set f = oFS.GetFile("C:\Users\Me\File.txt")...
  18. C

    Vba excel 2007 autofilter with one criteria which is a variable

    Hi... I'm trying to set the criteria field as not equal to my variable. I need the variable because this file will eventually be saved repeatedly as a new version with a different account number. I do not want to have to update code in each one. The code that I have works correctly to identify...
  19. S

    Macro is not working properly

    Hello Friends When i am running my macro,if my order_no is like 1,2,3,4,5,6,7, i.e primary, that time it is giving garbage value.and sub order no is like 1,2,3,4,8,9 in this 5,6,7 are missing which is also primary key, when i enter order no 1 so it will keep the sub_order no also it may be 3...
  20. thechazm

    Fastest way utilizing all cores on the CPU to find and delete rows that don't match criteria?

    Does anyone know what the fastest way utilizing all cores on the CPU to find and delete rows that don't match criteria? Currently I am trying to use an array to remove the items but for 16K+ rows to analyze plus only utilizing one core on the cpu it takes over 20 minutes. Below is my code if...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top