Hi. I am trying build an array in vb applications for excel. I am posting the code for what I am trying to write. Any help would be appreciated greatly.. - Sheets("C16-M-001").Select
-
Range("A2:H2").Select
-
If Range("C2").Value < (Date + 6) And Range("E2").Value < 10 Then
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
ElseIf Range("C3").Value < (Date + 6) And Range("E3").Value < 100 Then
-
Range("A3:H3").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C4").Value < (Date + 6) And Range("E4").Value < 100 Then
-
Range("A4:H4").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
ElseIf Range("C5").Value < (Date + 6) And Range("E5").Value < 100 Then
-
Range("A5:H5").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C6").Value < (Date + 6) And Range("E6").Value < 100 Then
-
Range("A6:H6").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C7").Value < (Date + 6) And Range("E7").Value < 100 Then
-
Range("A7:H7").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C8").Value < (Date + 6) And Range("E8").Value < 100 Then
-
Range("A8:H8").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
ElseIf Range("C9").Value < (Date + 6) And Range("E9").Value < 100 Then
-
Range("A9:H9").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C10").Value < (Date + 6) And Range("E10").Value < 100 Then
-
Range("A10:H10").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C11").Value < (Date + 6) And Range("E11").Value < 100 Then
-
Range("A11:H11").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
-
ElseIf Range("C12").Value < (Date + 6) And Range("E12").Value < 100 Then
-
Range("A12:H12").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
-
ElseIf Range("C13").Value < (Date + 6) And Range("E13").Value < 100 Then
-
Range("A13:H13").Select
-
Selection.Copy
-
Sheets("SCHEDULE").Select
-
Range("A8:H8").Select
-
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
-
:=False, Transpose:=False
4 3118
Hi. I am trying build an array in vb applications for excel. I am posting the code for what I am trying to write. Any help would be appreciated greatly..
If you have the code, why do you need help?
Seriously, you said "I am trying to build an array," but I do not see any array. Also, you post code that we cannot run. What is the problem (what is failing) and what are you trying to do? Thanks! --Sam
I posted the existing code sent to me.The person was getting the "Procedure to large". I could not post sll of the module here as the size limit won't allow it.
I posted the existing code sent to me.The person was getting the "Procedure to large". I could not post sll of the module here as the size limit won't allow it.
Ah, Excel is evil that way. You think that everything works great and add one thing, and you get screwy error messages. What has worked for me is to start over. :D
It's not that bad. You want to export all of the code modules, classes, and forms. You also want to copy any workbook/worksheet code and paste it into text files. Then delete all of the code that you have exported. Do a SaveAs with your workbook, close it and reopen. When you don't get any enable macros prompts, you know that you have removed all of the code.
Next, use the Edit, Move or copy sheets menu to create a new workbook from scratch. Again, close down Excel and try to open the new workbook. If it asks if you want to update links, you have a big problem: you'll need to recopy or correct the formulas so as to remove the links.
Now, you can import the code modules, classes, and forms back into you new workbook. Finally, open the text files and copy/paste the code into the proper worksheet/workbook.
Finally, you really, really need to write better code. All of those Selects are killing you. You very rarely need to do a Select. For example, your first 8 lines should look something like: - With Sheets("C16-M-001")
-
If .Range("C2").Value < (Date + 6) And .Range("E2").Value < 10 Then
-
.Range("A2:H2").Copy
-
Sheets("SCHEDULE").Range("A8:H8").PasteSpecial Paste:=xlPasteValues, _
-
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
or even - With Sheets("C16-M-001")
-
If .Range("C2").Value < (Date + 6) And .Range("E2").Value < 10 Then _
-
Sheets("SCHEDULE").Range("A8:H8").Value = .Range("A2:H2").Value
-
End With
Also at the top of each module/class/form you should have Option Explicit which will make sure that you have properly defined all of your variables. Hope this helps a little. Depending on the amount of code, you have a large job to do.
Thanks SammyB. The person doing the project is getting ready to rework it, but isn't a real exp programmer. It was originally written by her supervisor who simply recorded macros then pasted the code into modules, then copy and pastes over and over and over, you get the point. I will pass on the info to the person in nedd, and thanks again for the tips!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Allison Bailey |
last post by:
Hi Folks,
I'm a brand new Python programmer, so please point me in the right
direction if this is not the best forum for this question....
I would like to open an existing MS Excel spreadsheet...
|
by: Matthew Wieder |
last post by:
I have the following requirements:
Build a stand-alone C# application that asks the user to click in a cell
in an Excel spreadsheet, and then displays the address of that cell in
the C#...
|
by: pmud |
last post by:
Hi,
I need to use an Excel Sheet in ASP.NET application so that the users can
enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever
the USER ENETRS needs to go to the...
|
by: Howard Kaikow |
last post by:
There's a significant problem in automating Excel from VB .NET.
Reminds me of a problem I encountered almost 3 years ago that was caused by
the Norton Auntie Virus Office plug-in.
Can anybody...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |