|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Excel Macro Help Needed
My excel macro has stopped working. It appears to have stopped on or just after February 29th. Any ideas as to why?
|
|
#2
|
|||
|
|||
|
A monkey hacked into your code and left a banana peel that your code eventually stepped on, slipped, and crashed? Logically, that could have been the answer, but who knows! I wonder why it didn't crash on say, January 29th? Maybe the monkey wasn't hungry then?
|
|
#3
|
||||
|
||||
|
lol, blarche.... monkies don't hack Excel code, they only hack asp code. It was probably a ferrett. Umm, kicker.... you're going to have to give just a little more info. I mean, my car wouldn't start last week, do you know why?
The answer: I was drunk, inserting the keys in the glove compartment again trying to start my car, and I was on the wrong side..... Need just a little bit more information to help you out.
__________________
Did I help you? If so gimme rep by clicking on the at the top right corner of this post ![]() Madness does not always howl. Sometimes, it is the quiet voice at the end of the day saying, "Hey, is there room in your head for one more?" Last edited by sbenj69 : March 11th, 2008 at 04:22 PM. |
|
#4
|
|||
|
|||
|
More info on my issue
Below is the code that is used in the macro. It worked as it was supposed to on Feb25 then after the 29th it would no longer work as designed. Nothing has changed on my system since it last worked.
Sub importer() Dim wrkbk As Workbook Dim curbk As Workbook Set curbk = ActiveWorkbook Dim filt As String Dim countervar Dim offsetvar offsetvar = WorksheetFunction.CountA(Range("A:A")) countervar = 0 filt = InputBox("What filter do you want to use", "Filter", "MIPR") Dim nm nm = Application.Dialogs(xlDialogOpen).Show If nm = True Then Set wrkbk = ActiveWorkbook nm = wrkbk.ActiveSheet.Range("b1").Value While Len(nm) > 0 If InStr(wrkbk.ActiveSheet.Range("a1").Offset(countervar, 0).Value, filt) > 0 Then If WorksheetFunction.CountIf(curbk.ActiveSheet.Range( "B:B"), wrkbk.ActiveSheet.Range("b1").Offset(countervar, 0).Value) = 0 Then curbk.ActiveSheet.Range("1:1").Offset(offsetvar, 0).Value = wrkbk.ActiveSheet.Range("1:1").Offset(countervar, 0).Value offsetvar = offsetvar + 1 End If End If countervar = countervar + 1 nm = wrkbk.ActiveSheet.Range("b1").Offset(countervar, 0).Value Wend wrkbk.Close False End If End Sub |
|
#5
|
||||
|
||||
|
Do you get an error message,...? unfortunately something has changed since the 29th otherwise it would still be working
|
|
#6
|
|||
|
|||
|
I do not get any error messages. When I open the spreadsheet and run the macro all indications are that it runs. It opens the other sheet as it should andthen closes it but never copies any of the data as it should.
|
|
#7
|
||||
|
||||
|
the most likely cause would be that it's not retrieving the data correctly from the other sheet. Meaning it doesn't have any data to copy. Try doing a msgbox with the values of each record you are trying to copy before you copy it. My guess is it's not finding any records to copy.
Do a msgbox(nm) after this line: nm = Application.Dialogs(xlDialogOpen).Show If it doesn't = true at this point, then that's why it's not copying. If it does, we'll go onto the next part to debug. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Excel Macro Help Needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|