Click here to Skip to main content
16,010,297 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
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 
When I first tried to use the Excel macro code in VB 2005, it was clear that "Range" was not a valid data type therefore the code falls apart after "Dim range1 As Range." I'm just not sure how Excel data is read by VB and I'm not sure how to address the incoming data. In Excel, I use "ActiveSheet" and "Columns" to comb through the data but I am unable to find any information on how to do create an application in VB 2005 that will do something similar.

See underlined sections below as an example.

<br />
Module ShelfList<br />
<br />
    Sub calculateAmount()<br />
<br />
        Dim boAmount As Decimal<br />
        Dim boUnit As Integer<br />
        Dim shippedAmount As Decimal<br />
        Dim shippedUnit As Integer<br />
<br />
        boAmount = "0.00"<br />
        boUnit = 0<br />
        shippedAmount = "0.00"<br />
        shippedUnit = 0<br />
<br />
        Dim range1 As Range<br />
        range1 = ActiveSheet.Range("A1")<br />
<br />
        Do While range1.Value <> "Not Filled / On Order"<br />
            range1 = range1.Offset(1, 0)<br />
        Loop<br />
<br />
        range1 = range1.Offset(1, 0)<br />
<br />
        Do While range1.Value <> "Other"<br />
            range1 = range1.Offset(0, 17)<br />
            boAmount = boAmount + range1.Value<br />
            If range1.Value <> "" Then boUnit = boUnit + 1<br />
            range1 = range1.Offset(1, -17)<br />
        Loop<br />
<br />
        range1 = range1.Offset(0, 17)<br />
        'range1.Value = boAmount<br />
<br />
        range1 = range1.Offset(1, 0)<br />
        Do While range1.Value <> ""<br />
            shippedAmount = shippedAmount + range1.Value<br />
            If range1.Value <> "" Then shippedUnit = shippedUnit + 1<br />
            range1 = range1.Offset(1, 0)<br />
        Loop<br />
<br />
        'range1.Value = shippedAmount<br />
<br />
        'range1.Select<br />
<br />
<br />
        Sheets.Add()<br />
        Dim range2 As Range<br />
        range2 = ActiveSheet.Range("A1")<br />
<br />
        range2.Value = "Back Order Amount"<br />
        range2 = range2.Offset(0, 1)<br />
        range2.Value = boAmount<br />
<br />
        range2 = range2.Offset(1, -1)<br />
        range2.Value = "Back Order Units"<br />
        range2 = range2.Offset(0, 1)<br />
        range2.Value = boUnit<br />
<br />
        range2 = range2.Offset(1, -1)<br />
        range2.Value = "Shipped Amount"<br />
        range2 = range2.Offset(0, 1)<br />
        range2.Value = shippedAmount<br />
<br />
        range2 = range2.Offset(1, -1)<br />
        range2.Value = "Shipped Units"<br />
        range2 = range2.Offset(0, 1)<br />
        range2.Value = shippedUnit<br />
<br />
        Columns("A:A").EntireColumn.AutoFit()<br />
        Columns("B:B").EntireColumn.AutoFit()<br />
        Columns("A:A").Select()<br />
        Selection.Font.Bold = True<br />
        ActiveSheet.Name = "Totals"<br />
        ActiveWorkbook.Save()<br />
<br />
    End Sub<br />
<br />
End Module<br />

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 
QuestionMORE TEST PERFORMED: the situation is very curious and annoying!! [modified] Pin
Capitanevs16-Mar-08 13:09
Capitanevs16-Mar-08 13:09 
GeneralRe: MORE TEST PERFORMED: the situation is very curious and annoying!! Pin
Dave Kreskowiak17-Mar-08 5:25
mveDave Kreskowiak17-Mar-08 5:25 

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.