Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. WaterSprite

    VBA Project Sheet: ln39, col2

    On the toolbar of the VBA project sheet, there is a box that lists the line number and column of each individual letter of code. Is it possible to use that line number in code, as an example: [Select Case aaaa2] [Case VbNo] [If aaaa2 = VbNo Then Resume ln39, col2]
  2. WaterSprite

    Set (15/1440) as a variable

    Dim x As Date, xx As Integer, thisTime As Date,Date1 As Date Dim y As Date, z As Integer, a As Integer, b As Integer, bb As Integer, aa As Integer With Activesheet Cells.Clear aa = 10 bb = 9 b = 384 Date1 = Format$(Date, "dd-mmm-yyyy hh:mm") Cells(9, 1).Value = Date1...
  3. WaterSprite

    Open OutLook2007 with VBA code

    I know this is probably the wrong forum for this question, but I do not know where else to ask. Is it possible to open E mail in Microsoft Outlook from an Excel Spreadsheet using a Macro?
  4. WaterSprite

    CurrentRegion.sort

    The Macro recorder gave me this: [Range("A1:K11588").Sort Key1:=Range("A1"),] The bottom row will not always be 11588, so, Can I replace the hard coded range with: [With Activesheet] [.cells(1,1).currentregion.sort]
  5. WaterSprite

    Count Pages Sent to the Printer

    I would like help with something like this: [If printout.page.count = 5 then Active.workbook.save else _ error in printout] The page count will always be 5, so I just want to be able to count how many times the print command has been sent to the printer at a given time.
  6. WaterSprite

    Using Variables with Edate

    [Dim x As Date, xx As Integer] [x = Cells(1, 1).Value] [xx = 12] [Cells(2, 1).FormulaR1C1 = "=Edate(R1C,R1C2)"] Can I use "Edate" with variables, as in the line of code below. If I could at least figure out how to use a variable for 12 it would help a lot. [Cells(2, 1).FormulaR1C1 =...
  7. WaterSprite

    Format a Variable

    [Select Case aa13] [Case vbYes] [Cells(11, 2) = aa12 & aa36] [Case vbNo] [Cells(11, 2) = aa12 & ":No:" & aa38] [End Select] This code works just fine, it is from the help I received from a lot of you in the last couple of weeks, my Select Case question from 20 September 2010. Now, for my...
  8. WaterSprite

    Stop

    This is sort of a continuation of my Select Case question from 22 September, 2010. I took everyone's advice about not using input boxes for data entry. So, now my problem. I am using a drop down list in 3 cells for names to be selected from a preset list and placed in a cell. I am using...
  9. WaterSprite

    Select Case

    The following code works: Dim aa7 as string, aa8 as string aa7 = "Maintenance Notified:" aa8 = Inputbox(Maintenance Notified, Enter Yes, or No") if aa8 = "yes" then cells(8,2) = aa7 & chr(32) & aa8 This code does not work: Dim aa7 as string, aa8 as string aa7 = "Maintenance...
  10. WaterSprite

    Absolute Reference to current row

    [MyRow3 = Cells(Application.Rows.Count, 3).End(xlUp).Row + 8] [Cells(MyRow3, 3).Activate] [ActiveWorkbook.Names.Add Name:=("PB9"), _ RefersToR1C1:="=!RC3:RC16"] [Range("PB9").FormulaR1C1 = "=RANDBETWEEN(1,59)"] [Range("PB9").Interior.ColorIndex = 4] I thought in R1C1...
  11. WaterSprite

    Dim statements

    Option Explicit [Dim pf As String] [Public pf As String] Do I need both of these statements? My goal is to have the variable [pf] available to the entire project. I have never done that before. I just usually do Dim statements in the modules. I went to the VBA help files, but could...
  12. WaterSprite

    Array question

    [ myArray1 = Worksheets("sheet5").Range("MyTotal_Data_12") ] How can I use "ActiveSheet" in place of "Sheet5" in the above line of code. I tried doing: DIM Activesheet as Worksheet, But I still got an error.
  13. WaterSprite

    Running Multiple Macros

    Is there a way to run multiple macros without typing out each Macro line by line? Something like Macro34:Macro57 Or maybe a version of the Application.run
  14. WaterSprite

    "Set" MyDate, MyNum etc

    Is the use of "Set" in a line of code outdated. In the last two days, any spreadsheet that I have with "Set" at the beginning of the line of code is not working, even though it has worked up to now for the last two or three years with that code. Set MyDate = Worksheets("Sheet1").Range("A1")...
  15. WaterSprite

    Cell activation upon "Enter"

    I would like to activate a cell upon entering data into a cell. The equivilant of enter data, move two cells to the right, enter data, two cells to the right, etc. I tried this: private Sub worksheet_selection change byvalue(target as Range) Activecell.Offset(0,2).activate end sub it worked...
  16. WaterSprite

    Countif(RC4, < >)

    Activecell.FormulaR1C1 = "=Countif(RC4, "">15,<31"")" I get a zero when I run this on a number between 15 and 31. Is there a way to use Countif with less than, greater than. And I am clueless about how to use the TGML to identify my lines of code in my questions. I have the "process TGML"...
  17. WaterSprite

    ActiveCell.Activate

    My Code: I just run this with a loop 31 times. Works great. [ActiveCell.Value = ActiveCell.Offset(0, -1) - ActiveCell.Offset(1, -1)] [Activecell.Offset(1, 0).Activate] My Question: It is suggested that we not use Activate, Select, etc as it slows our code down. I just do not know how else...
  18. WaterSprite

    VBA Macros

    Ok. Time for an RSQ.(Really Stupid Question) When I start a project, I usually prepare several blank macros ahead of time, using tools, macro, record new macro, ok on the box, then stop button. I do this several times so the Macros are in the same module. Is there a faster way, or will VBA...
  19. WaterSprite

    If then statement

    ThisRow = Cells(65536,33).End(xlup).Row Cells(ThisRow, 33).Activate For i = ThisRow to 9 Step -1 if Cells(i, "AG") > 1 Then Cells(i, "AJ").value = "=(Cells(i, AG)-Cells(i,AH)))" Next i End sub This works down to the if statement. I looked in the FAQ's and also searched under If Then, but...
  20. WaterSprite

    References - VBA project

    I know this is probably the wrong place to ask this, but I am comfortable with this forum, so here goes. How do I know which of the available references that I am supposed to have checked when I click on Tools, References on the VBA code page. What makes me ask this is I have been playing...

Part and Inventory Search

Back
Top