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]
PHV, your solution worked perfectly. BTW, I think you gave me the named range code that I am using in this a couple of years ago. So, thanks for the named range code and for this new code.
After I saw yours, I realized I had sort of been all around what you did, just never thought of moving...
...b & "C1"
Range("PB9").FormulaR1C1 = "=(R[-1]C1) + (15/1440)"
Range("PB9").NumberFormat = "dd-mmm-yyyy hh:mm"
End With
*********************************
This code, as you see it, works. What I want to do, and have spent almost two days trying to do,
is set the...
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?
yes, but with 11,588 rows and 10 columns, it is not easy to check each row to see how the sort worked. The data I am being given to work with has been downloaded to Excel from something called "Crystal Reports", and I have had more than my share of trouble writing code that works.
So, I thought...
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 =...
Fumei,
I understand your concern with use of Flash Drives for long term storage. But that is not what I am doing. We have no physical connection between the computers we use at work and the outside world. So, anything I figure out at home, help I get from here or from the internet, I have to...
Skip, I am ready to learn something new. Tell me what to do.
I found Export File. When I clicked on it, it took me to something called Office10.
So, where do I need to export the module to and how do I reopen it if I need the code. And, can I export to a USB (Flash) Drive.
Thanks.
WaterSrite
The reason I prefer to use code for the spreadsheets is that others use them and I have learned that if there are formula's in the individual cells, sooner or later someone is going to play with them. If I do everything in code, they can play all they want, but no permanent damage done.
And...
[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...
I copy everything to NotePad, save it as a text file in a folder named, VBCodeSnippets. Works well, also serves as sort of a backup for me, even if I lost the spreadsheet, just build a new one, recopy the code from the text and I am back in business.
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.