Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-26-2008, 07:06 AM
gjfeng@yahoo.com
 
Posts: n/a
Help with coding...

Anyone mind to help me take a look at my code? It's in the nvT Sheet.
I'm getting this:
http://www.geocities.com/gjfeng/no.bmp
the desired outcome is:
http://www.geocities.com/gjfeng/yes.bmp

The part which controls the qty value is:
qty = Worksheets("db").Cells(intRow, 8).Value
'Sheets("nvT").Range("c" & Columns.Count).End(xlUp)(2).Resize(,
1).Value = qty
Worksheets("nvT").Range("IV7", Worksheets("nvT").Cells(7,
Columns.Count).End(xlToLeft))(3).Value = qty

link: http://www.geocities.com/gjfeng/protoV2.xls



Code:
Private Sub CommandButton1_Click()
If Sheets("nvT").Range("b1").Value = "" Then
msgbox "The Date Is Empty!"
Else
Dim box1 As Integer
box1 = msgbox("Ok to Update?", 1 + vbInformation, "Clear Confirm")
If box1 = 1 Then
Dim intRow As Integer
intRow = 2
Do While Worksheets("db").Cells(intRow, 2).Value <> ""
If CStr(Worksheets("db").Cells(intRow, 1).Value) =
Sheets("nvT").Range("b1").Value Then

proID = Worksheets("db").Cells(intRow, 6).Value
pro = Worksheets("db").Cells(intRow, 7).Value
Worksheets("nvT").Range("IV5", Worksheets("nvT").Cells(5,
Columns.Count).End(xlToLeft))(3).Value = proID
Worksheets("nvT").Range("IV6", Worksheets("nvT").Cells(6,
Columns.Count).End(xlToLeft))(3).Value = pro
'Iv5 must match the number 5, IV6 must match the number 6,
they determine the row
'the number in (3), 3 leaves 1 empty space inbetween, 4 leaves
2 empty space

cusID = Worksheets("db").Cells(intRow, 5).Value
cus = Worksheets("db").Cells(intRow, 4).Value
Sheets("nvT").Range("a" & Columns.Count).End(xlUp)(2).Resize(,
2).Value = _
Array(cusID, cus)

qty = Worksheets("db").Cells(intRow, 8).Value
'Sheets("nvT").Range("c" & Columns.Count).End(xlUp)
(2).Resize(, 1).Value = qty
Worksheets("nvT").Range("IV7", Worksheets("nvT").Cells(7,
Columns.Count).End(xlToLeft))(3).Value = qty
End If

intRow = intRow + 1
Loop

Else
End If 'End of Box1
End If 'End of check if empty IF statement

End Sub
Private Sub CommandButton2_Click()
Dim box1 As Integer
box1 = msgbox("Ok to Clear?", 1 + vbExclamation, "Clear Confirm")
If box1 = 1 Then
Worksheets("nvT").Cells.Value = ""
Range("a1").Value = "Order Date"
Range("a2").Value = "Delivery Date"
Range("a3").Value = "Posting Date"
Range("a4").Value = "Unit Price"
Range("a5").Value = "Product ID"
Range("a6").Value = "Product"
Range("c1").Formula = "=IF(B1="""","""",TEXT(WEEKDAY(B1),""ddd""))"
Else
End If

End Sub
Private Sub CommandButton3_Click()
Range("b1").Value = "=TODAY()"
Range("b2").Value = "=TODAY()"
Range("b3").Value = "=TODAY()"
End Sub
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:12 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Arturo Perez Reverte | Internet Advertising | Personal Loans | Credit Cards | Mortgage Calculator



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114