ªí®æ(OrderForm)¸ê®Æ·|¦Û°ÊÂಾ¨ìOrderData sheet
¦bªí®æ¤¤ªºCase type ¬Odrop down list ¦³Red, White,Mixed
½Ð°Ý¤@¤U¦p¦ó¥OQuantity®Ú¾Ú«e±ªºCase type Âಾ¨ìOrderData sheet
¦]¬°ªí®æ¸ê®Æ²{¦b¥u·|¶¶§Ç¦aÂಾ¨ì¤u§@ªí
¦pªGcase type ùتº¿ï¶µ¤£¦P¤F¡A¨º¤£·|match ¤u§@ªí¤¤ªºredno, white no, mixed no ªº¼Æ¥Ø
¥i¯à§Úªºªí¹F¤£²M·¡¡A¦ý½Ð°ª¤âÀ°¦£
³o¥÷excel¬O¤j¾Çªºassignment
[attach]19502[/attach]
[attach]19503[/attach]
[attach]19504[/attach]
Sub TransferDetails()
'
' TransferDetails Macro
' This Macro will make a record of the current details in the order form.
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Sheets("OrderData").Select
'This IF statement will determine whether or not there is a value in the first row of the database and will paste the data accordingly
If IsEmpty(ActiveSheet.Range("A2")) Then
Range("A2").Select
Else
Sheets("OrderForm").Select
Sheets("OrderData").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
End If
Sheets("OrderForm").Select
Range("D14").Select
Selection.Copy
Sheets("OrderData").Select
Selection.PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(0, 1).Range("A1").Select
' Forloop starts here
Sheets("OrderForm").Select
Dim Winetype As Integer
Dim RWM As String
RWM = ("RWM")
For Winetype = 1 To 3
' LOOP ONE
' This section places the Wine Type Into the RWM Cell for referencing
' 2.1
'2.1.1
Sheets("OrderForm").Select
' 2.1.2
'2.1.2.1
Range("C17").Select ' <--- C17 = Base Cell
'2.1.2.2
ActiveCell.Offset(0, 0).Range("A1").Select ' <--- No Change Due to First Iteration
'2.1.3
'2.1.3.1
Selection.Copy
'2.1.3.2.
Sheets("Price&GiftInfo").Select
Range("RWM").Select
Selection.PasteSpecial Paste:=xlPasteValues
'2.2
'2.2.1
Sheets("OrderForm").Select
'2.2.2
ActiveCell.Offset(0, 2).Select
'2.2.3
Selection.Copy
'2.3
'2.3.1.
Sheets("OrderData").Select
ActiveCell.Select ' <---- No current movement as First Iteration