Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-18-2015, 06:15 AM
Vibov Vibov is offline Value of Combobox in other userform Windows 7 32bit Value of Combobox in other userform Office 2010 32bit
Novice
Value of Combobox in other userform
 
Join Date: Jan 2015
Posts: 8
Vibov is on a distinguished road
Default

I have tried to get the value from the combobox and put it in a variable but it alway turn out empty.

Public Sub CommandButton4_Click()
bodymailtext = Antal1 & Antal2 & antal5 & TEST1
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
With OutlookMail
.To = "Martin.Vibov@peri.dk" ' "Martin.vibov@peri.dk"
.CC = "" ' Husk at ændre disse 2 (TO og CC), hvis der skal testet
.BCC = ""
.Subject = "Fremtidige udsmidninger "
.Body = bodymailtext
'"Hej Kim og Peter" & vbNewLine & vbNewLine & "Dette er hvad der forventes, at blive smidt ud" & vbNewLine & vbNewLine & _
"Vare" & vbTab & "Antal" & vbTab & "Sti til billeder" & vbTab & "Peri eller Kunde Scrot" & vbTab & "Total KG." & vbNewLine & _
Antal1 & vbTab & Abtal2 & vbTab & "Variabler skal ind her" & vbNewLine & _
"Med Venlig Hilsen" & vbNewLine & "PERI Logistik"
.Send
End With

Set OutlookMail = Nothing
Set OutlookApp = Nothing

Sheets("Dropdown").Select
Unload Me
End Sub


Public Sub CommandButton1_Click()
'Application.ScreenUpdating = False
strbruger = Environ("username")
Dato = Date
Dato1 = Dato

Dato1 = Format(Dato, "ww")
If Anden <> "" Then
Sheets("Scrap").Range("A3").Value = Anden
Sheets("Scrap").Range("B3").Value = AndenQTY
'Sheets("Scrap").Range("C3").Value = "X:\PERI skrot 2015\Peri skrot i ugere\" & Dato1 & "\"
With Worksheets("Scrap")
.Hyperlinks.Add Anchor:=.Range("C3"), _
Address:="X:\PERI skrot 2015\Peri skrot i ugere\" & Dato1 & "\"
End With

Sheets("Scrap").Range("D3").Value = strbruger
Sheets("Scrap").Range("E3").Value = Dato

If Kundescrott = True Then
Sheets("Scrap").Range("F3").Value = "Kunde Scrott"
Else
Sheets("Scrap").Range("F3").Value = "Peri Scrott"
End If


Sheets("Scrap").Select
Range("H3").Select

Sheets("Scrap").Select
Range("I3").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[-8],6)"
' ActiveCell.FormulaR1C1 = "=IF(R[]C[-1]="""","""",TODAY())" ' Denne er kun aktuel, hvis datoen ikke ændres sig når dokumentet åbnes

Range("J3").Select ' Denne og nedestående linje skal ændres, når jeg ved hvor Dejan ligger excel dokumentet
'ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'C:\Users\vibov\Desktop\[Copy of 0243 article price list.xls]price list, Product Group'!R1C4:R65536C20,17,FALSE)"
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'G:\Martin Vibov\Projekter\Scrap\[Copy of 0243 article price list.xls]price list, Product Group'!R1C4:R10000C20,4,FALSE)"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-1]*RC[-9])"

Rows("3:3").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Else: End If


Sheets("Dropdown").Select
Unload Me
Dato = ""
Dato1 = ""
'Application.ScreenUpdating = False
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create UserForm ComboBox or ContentControl ptmuldoon Word VBA 11 01-17-2015 05:58 PM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
Value of Combobox in other userform Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
ComboBox ListIndex = -1 even though it does NOT = -1 Joe Patrick Word VBA 0 08-03-2011 08:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft