Hi... My first time posting here...
I'm a noob to VBA. I'm used to managing products with a .xls file but my co-workers are struggling using the file because they're regular computer users.
My plan is to create a Macro-Enabled Excel File that will be easy to use to everyone. I want to make it sort of like an app, to help automate tasks.
1. My issue today is within the Tasks sheet
___________
2. Products Database sheet
Sheet that has 1 table(products_database) that holds all the products for our online store
------------------------------------
Plan of Function
How I want this code to to function
1. I paste allskus from the pricelist/catalogue in tasks_all["SKU"] column
2. then tasks_all["Task"] will match all skus in tasks_all["SKU"] with products_all["SKU"] which is located in the "Products Database" sheet
2.1 If SKUs matches, the value must be "Update"
2.2 Else, the value must be "Add New"
So far this code works... This is what I currently have:
Thanks in advance... Your respond will be much appreciated
I'm a noob to VBA. I'm used to managing products with a .xls file but my co-workers are struggling using the file because they're regular computer users.
My plan is to create a Macro-Enabled Excel File that will be easy to use to everyone. I want to make it sort of like an app, to help automate tasks.
1. My issue today is within the Tasks sheet
Code:
Sheet Name: Tasks
tasks_all
Table to hold all SKUs for the task of the day / listing all products from a PDF catalogue
tasks_update
Table to hold all SKUs that needs to be updated
tasks_add
Table to hold all SKUs that needs to be added
tasks_do_later
Table to hold all SKUs that are discontinued or not yet available or with incomplete information
___________
2. Products Database sheet
Sheet that has 1 table(products_database) that holds all the products for our online store
------------------------------------
Plan of Function
How I want this code to to function
1. I paste allskus from the pricelist/catalogue in tasks_all["SKU"] column
2. then tasks_all["Task"] will match all skus in tasks_all["SKU"] with products_all["SKU"] which is located in the "Products Database" sheet
2.1 If SKUs matches, the value must be "Update"
2.2 Else, the value must be "Add New"
VBA Code:
Sub AutomateTasksSample()
Dim MatchSKU As Integer
MatchSKU = Application.WorksheetFunction.CountIf(Sheet2.Range("F1:F99999"), Sheet7.Range("C1:C99999"))
If MatchSKU = 1 Then
' APPEND ALL MATCHING SKUs TO [B]tasks_update[SKU][/B]
Else
' APPEND ALL MATCHING SKUs TO [B]tasks_add_new[SKU][/B]
End If
End Sub
So far this code works... This is what I currently have:
VBA Code:
Sub AutomateTasksSample()
Dim MatchSKU As Integer
MatchSKU = Application.WorksheetFunction.CountIf(Sheet2.Range("F1:F99999"), Sheet7.Range("C1:C99999"))
If MatchSKU = 1 Then
MsgBox "Found - Update Product"
Else
MsgBox "Not Found - Add Product"
End If
End Sub
Thanks in advance... Your respond will be much appreciated