Click here to Skip to main content
15,914,163 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to convert a value to a string with decimal point instead of comma Pin
DCAUB15-Mar-08 1:28
DCAUB15-Mar-08 1:28 
GeneralRe: How to convert a value to a string with decimal point instead of comma Pin
Colin Angus Mackay15-Mar-08 4:08
Colin Angus Mackay15-Mar-08 4:08 
QuestionHow to send a string over the internet to another pc Pin
softwarejaeger15-Mar-08 0:17
softwarejaeger15-Mar-08 0:17 
GeneralRe: How to send a string over the internet to another pc Pin
Dave Kreskowiak17-Mar-08 5:32
mveDave Kreskowiak17-Mar-08 5:32 
QuestionUsing System.windows.forms.datagrid Pin
shaeron14-Mar-08 22:36
shaeron14-Mar-08 22:36 
GeneralRe: Using System.windows.forms.datagrid Pin
Mycroft Holmes15-Mar-08 21:50
professionalMycroft Holmes15-Mar-08 21:50 
GeneralHowTo Refresh Data Bound Controls in VB.NET Compact Edition Pin
swdev.bali14-Mar-08 18:37
swdev.bali14-Mar-08 18:37 
QuestionConverting Excel VBA module code to VB 2005/VB.NET Pin
Graham Latto14-Mar-08 14:39
Graham Latto14-Mar-08 14:39 
Hello everybody,

The code below is a VBA code I originally created for a MACRO in excel 2003. My goal is to be able to execute the code below from a VB 2005/VB.NET module/application. In other words, could someone help me out with correcting the syntax errors? I'm quite confident about my excel VBA skills, but I am so stuck on converting this to VB 2005/VB.NETAny help would be so tremendously appreciated. I've tried reseraching what I can do, but unfortunately, I'm completely stuck.

Module ShelfList


Sub calculateAmount()

Dim boAmount As Decimal
Dim boUnit As Integer
Dim shippedAmount As Decimal
Dim shippedUnit As Integer

boAmount = "0.00"
boUnit = 0
shippedAmount = "0.00"
shippedUnit = 0

Dim range1 As Range
range1 = ActiveSheet.Range("A1")

Do While range1.Value <> "Not Filled / On Order"
range1 = range1.Offset(1, 0)
Loop

range1 = range1.Offset(1, 0)

Do While range1.Value <> "Other"
range1 = range1.Offset(0, 17)
boAmount = boAmount + range1.Value
If range1.Value <> "" Then boUnit = boUnit + 1
range1 = range1.Offset(1, -17)
Loop

range1 = range1.Offset(0, 17)
'range1.Value = boAmount

range1 = range1.Offset(1, 0)
Do While range1.Value <> ""
shippedAmount = shippedAmount + range1.Value
If range1.Value <> "" Then shippedUnit = shippedUnit + 1
range1 = range1.Offset(1, 0)
Loop

'range1.Value = shippedAmount

'range1.Select

Sheets.Add()
Dim range2 As Range
range2 = ActiveSheet.Range("A1")

range2.Value = "Back Order Amount"
range2 = range2.Offset(0, 1)
range2.Value = boAmount

range2 = range2.Offset(1, -1)
range2.Value = "Back Order Units"
range2 = range2.Offset(0, 1)
range2.Value = boUnit

range2 = range2.Offset(1, -1)
range2.Value = "Shipped Amount"
range2 = range2.Offset(0, 1)
range2.Value = shippedAmount

range2 = range2.Offset(1, -1)
range2.Value = "Shipped Units"
range2 = range2.Offset(0, 1)
range2.Value = shippedUnit

Columns("A:A").EntireColumn.AutoFit()
Columns("B:B").EntireColumn.AutoFit()
Columns("A:A").Select()
Selection.Font.Bold = True
ActiveSheet.Name = "Totals"
ActiveWorkbook.Save()

End Sub

End Module
GeneralRe: Converting Excel VBA module code to VB 2005/VB.NET Pin
Paul Conrad14-Mar-08 14:59
professionalPaul Conrad14-Mar-08 14:59 
QuestionRe: Converting Excel VBA module code to VB 2005/VB.NET Pin
Graham Latto14-Mar-08 15:26
Graham Latto14-Mar-08 15:26 
GeneralRe: Converting Excel VBA module code to VB 2005/VB.NET Pin
ChandraRam16-Mar-08 23:29
ChandraRam16-Mar-08 23:29 
QuestionCheck for a foder or a file Pin
Assaf8214-Mar-08 10:50
Assaf8214-Mar-08 10:50 
GeneralRe: Check for a foder or a file Pin
Dave Kreskowiak14-Mar-08 10:55
mveDave Kreskowiak14-Mar-08 10:55 
GeneralRe: Check for a foder or a file Pin
Assaf8214-Mar-08 10:57
Assaf8214-Mar-08 10:57 
GeneralRe: Check for a foder or a file Pin
Dave Kreskowiak14-Mar-08 12:22
mveDave Kreskowiak14-Mar-08 12:22 
Generalcheck for the existance of a folder Pin
Assaf8214-Mar-08 10:25
Assaf8214-Mar-08 10:25 
GeneralRe: check for the existance of a folder Pin
Assaf8214-Mar-08 10:30
Assaf8214-Mar-08 10:30 
GeneralStrange trouble in Calling a DLL compiled in C++ Pin
Capitanevs14-Mar-08 5:03
Capitanevs14-Mar-08 5:03 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Tim Carmichael14-Mar-08 5:25
Tim Carmichael14-Mar-08 5:25 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Capitanevs15-Mar-08 10:04
Capitanevs15-Mar-08 10:04 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Dave Kreskowiak14-Mar-08 8:10
mveDave Kreskowiak14-Mar-08 8:10 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Capitanevs15-Mar-08 9:59
Capitanevs15-Mar-08 9:59 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Dave Kreskowiak15-Mar-08 11:22
mveDave Kreskowiak15-Mar-08 11:22 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Capitanevs16-Mar-08 11:24
Capitanevs16-Mar-08 11:24 
GeneralRe: Strange trouble in Calling a DLL compiled in C++ Pin
Dave Kreskowiak17-Mar-08 5:22
mveDave Kreskowiak17-Mar-08 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.