Hi Tony,
Sure, no rush, my deadline for this tool is on the 3rd of May. I'd be happy to look at any code you can produce and tailor/incorporate it into the tool. I would highly appreciate that.
Anyway, I've been trying to do a while, wend statement since this morning and no luck so far. My...
Hello Tony,
Thanks for your reply. One way I could think of doing it would be to sort the records, write a loop code and set a flag. Would it be possible though to do it without having to sort the records? Problem is, the users of the tool I'm working on will need to change names here and...
Alright, point well taken. I'm using an error handler in the same code, replacing "createobject" with "getobject" and using err.document and another variable to set a flag. It still has a hole though, since when you close MS Word manually and do not specify to close Word in the macro, it still...
Hello Skip,
It's not that I absolutely have to code without error handlers, it's just a preference I have and I think it's practical since if something screws up in the code, it will continue to run (assuming it's something that can be handled) without notifying the user that something went...
Hi Skip,
Thanks for your help and reply. I've actually read that. I'd like to make this macro open Word and a new document if an instance doesn't exist, and use an existing instance when one exists. There's gotta be a way to create this condition without using error handlers. Any other takes...
Hello All,
I've been tasked by my manager to create a macro that would copy a range of cells from MS Excel to MS Word. So basically when it gets transferred to Word, it becomes a table. Here's the code:
Application.ScreenUpdating = False
Dim appWD As Word.Application, docWD As...
Hello Skip,
I'm so sorry, I forgot to mention I'm making this macro work from a commandbutton. Sure, it does work if you run it as a macro, but from a commandbutton, sure does give me that error.
Thanks for your help!
Marvin
Hello Skip,
Thanks for your reply, but I already tried that. I thought the syntax for both protect and unprotect would be the same but if you check the help menu, it gives you a different syntax for each method. By the way, the error I'm getting is:
Run Time Error 1004
Unprotect Method of...
Hello Geoff,
Thanks for your reply. For some reason, when it executes the line:
ActiveSheet.Copy Before:=Workbooks(svname).Sheets(1)
it gives me the error "Copy Method of Worksheet Class Failed."
Though when I execute it as a macro in a module, it works just fine. My co worker told...
Ok, here's the code I did last night:
Private Sub Create_Copy_Click()
Unload UserOptForm
SrvArea = Range("d5")
svname = SrvArea & " - BOBCopy.xls"
Workbooks.Add.SaveAs FileName:=svname
Windows("The 2004 Book of Business Report.xls").Activate...
Hello Skip,
Thanks for the tip. Although the code only does half of what I wanted it to do. I actually wanted to paste the entire row to sheet 2. The code only cuts and paste the purchaser id found. I have yet to understand the arguments in your code too ;). Maybe you can explain what the...
Ok, here's the code:
Application.ScreenUpdating = False
Columns("a:a").Select
PurchID = "221"
If TypeName(Cells.Find(PurchID)) <> "Range" Then
MsgBox ("Purchaser ID not found!")
Range("a1").Select
Else: Cells.Find(PurchID).Activate...
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.