Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questioncan't load text to a form from a file Pin
winsane13-May-08 8:36
winsane13-May-08 8:36 
AnswerRe: can't load text to a form from a file Pin
C1AllenS13-May-08 10:15
C1AllenS13-May-08 10:15 
AnswerRe: can't load text to a form from a file Pin
Christian Graus13-May-08 11:52
protectorChristian Graus13-May-08 11:52 
AnswerRe: can't load text to a form from a file Pin
Ed.Poore13-May-08 13:19
Ed.Poore13-May-08 13:19 
Questionstring checking Pin
asha_s13-May-08 7:45
asha_s13-May-08 7:45 
AnswerRe: string checking Pin
C1AllenS13-May-08 8:27
C1AllenS13-May-08 8:27 
GeneralRe: string checking Pin
asha_s13-May-08 9:10
asha_s13-May-08 9:10 
QuestionvbScript - I want to know howe I declare a Public variabel... [modified] Pin
keda13-May-08 5:07
keda13-May-08 5:07 
Hello, I have 2 Excelbooks, ver8 and ver9. And I must have a value whith me in to ver8 created in ver9. But I failed in all my tryings...

I start the Excelbook ver9 and whithin the macro in ver9 I started Excelbook ver8. I want to passed an If-statement whith help of this public variable (NyVerNr) from ver9 but I cant transfer the value in the public variable "NyVerNr" - howe do I do this ?

I try this code:

Public OldVerNr As Integer
Public NyVerNr As Integer
---------------------------------------------------------------
Private Sub FetchFlexTime_Click()

Dim OldVer As String
Dim NyVerNrText As String
Dim NyYearNr

Application.ScreenUpdating = False

OldVer = "F:\Documents\Flextid8.xls"

NyVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
NyVerNr = Right(NyVerNrText, 2)

' this is all right - now I have a value in NyVerNr !

Workbooks.Open Filename:=OldVer

"and now is ver8 open - and here is the macro in ver8"


Private Sub Workbook_Open()

Dim NyVerNr As Integer
Dim OldVerNr As Integer
Dim VerNr As Integer

'fetch the earlier NyVerNr and calculate the difference. The OldVerNr is 8 the NyVerNr should be 9
OldVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
OldVerNr = Right(OldVerNrText, 2)
VerNr = NyVerNr - OldVerNr

' but when I come to this part I have lost the value in NyVerNr, fetch from ver9
' the result for VerNr should be 1 - whitch means that I will passed this If-statement !
If VerNr <= 0 Then

please help me to get right !

/keda Confused | :confused:

modified on Tuesday, May 13, 2008 11:17 AM

Questionxml in .net Pin
subbu.sk13-May-08 4:40
subbu.sk13-May-08 4:40 
AnswerRe: xml in .net Pin
Christian Graus13-May-08 11:54
protectorChristian Graus13-May-08 11:54 
QuestionCommunication between multiple instances of a program with Shared members and events Pin
bixtra13-May-08 4:27
bixtra13-May-08 4:27 
AnswerRe: Communication between multiple instances of a program with Shared members and events Pin
Christian Graus13-May-08 11:54
protectorChristian Graus13-May-08 11:54 
GeneralRe: Communication between multiple instances of a program with Shared members and events Pin
bixtra13-May-08 20:35
bixtra13-May-08 20:35 
QuestionConvert RTF to PDF programmatically Pin
quioske13-May-08 2:08
quioske13-May-08 2:08 
AnswerRe: Convert RTF to PDF programmatically Pin
Ed.Poore13-May-08 13:17
Ed.Poore13-May-08 13:17 
QuestionRow header Numbering Pin
Mohammad Al Hoss13-May-08 1:19
Mohammad Al Hoss13-May-08 1:19 
AnswerRe: Row header Numbering Pin
Rupesh Kumar Swami13-May-08 1:38
Rupesh Kumar Swami13-May-08 1:38 
GeneralRe: Row header Numbering Pin
Mohammad Al Hoss13-May-08 2:02
Mohammad Al Hoss13-May-08 2:02 
QuestionVB.NET Pin
monika_vasvani12-May-08 23:43
monika_vasvani12-May-08 23:43 
AnswerRe: VB.NET Pin
Christian Graus13-May-08 0:03
protectorChristian Graus13-May-08 0:03 
AnswerRe: VB.NET Pin
jhoga13-May-08 3:07
jhoga13-May-08 3:07 
QuestionVBA Help, just a quicky [modified] Pin
harveyhanson12-May-08 22:50
harveyhanson12-May-08 22:50 
AnswerRe: VBA Help, just a quicky Pin
ChandraRam13-May-08 2:46
ChandraRam13-May-08 2:46 
QuestionEvents handling Pin
Chaitanya kumar CVSS12-May-08 22:11
Chaitanya kumar CVSS12-May-08 22:11 
AnswerRe: Events handling Pin
Christian Graus12-May-08 22:27
protectorChristian Graus12-May-08 22:27 

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.