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]
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...
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?
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]
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.
[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 =...
[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...
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...
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...
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...
[ 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.
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
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")...
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...
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"...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.