Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all 49921 articles
Browse latest View live

When the data in a cell changes, automatically take a record of this change data

$
0
0
Hi All,

I am not sure how to go about creating a spreadsheet that does this:

I have a number much like a stock market index which is in cell A1 for instance,
and this data changes every second,

And I wish to create my spreadsheet to automatically make a record of this change value and populate it at the next available blank column, so ultimately, I have a full history of how this number changes during the course of time.


say

5450 in cell A1
a second later, it changes to 5430
and so I want to populate 5430 to B1

and then another second, it changes from 5430 to 5470
and so i want to populate 5470 to C1 and so forth....



does anyone know how to do it?


thank you!

Please help finish this macro - need to increment by 1

$
0
0
Ive had some help creating the attached macro

currently it only copy' and paste

I need to increment the first line (door number) by 1 for each time it is copied.

So from Flat 1 it will increment to Flat 10 if copied 10 times

Thank you
Attached Files

VBA SpellWord

$
0
0
Hi,

I'd like to seek any help. I already figured out the code needed to convert numeric value into English word in excel. However, I'd like to change the decimal figure to 20/100 instead of twenty cents. Can anyone give me a code on how to do this?

Thank you very much in advance.

Writing data on last empty cell in a column

$
0
0
Hi!
So.. I select a Phase , which gives me the specific structure codes for that phase, then I input the number of sets that are needed. Finally, I press the command button to record the data in the "Data" sheet . It writes the data on the "Data" worksheet in the first column (pcs) However, if I enter another set of data from the "Steel Pole" Worksheet, it overwrites the previously recorded data. My guess is because I assigned numerical values to the row and column in my vba code. Possible fix would be to find the next empty cell in the column and make the next set of data write from there. Any help would be much appreciated :)

Dropbox file for Reference
https://www.dropbox.com/s/f35c4e07vl...lock.xlsm?dl=0

Prevent Pasting of data that is not part of the Data Validation

$
0
0
Hi All - I would like to seek your assistance in helping me create a vba code that will do the following:

1. Allow copy/paste of data on a cell with a Data Validation and Force/Keep the destination format of the cell if the information to be entered/paste is part of the Data Validation list assigned in the cell
2. Prohibit pasting of the information if the information to is not part of the Data Validation list
3. A message box will appear saying "Incorrect Data"

Thank you in advance.

Macro to pull from GAL based on excel values

$
0
0
Hi there,

I would like to find out if its possible to pull outlook contact information (department, full name, company name, telephone number, alias, mobile number - in that order) from the global address book into Excel 2013 based on employee email address.

For example, in Column A I will have a range of email addresses and from there, run a macro to fill out the above mentioned fields.

I have the found the following code that pulls information based on User ID but I am having trouble modifying the code:

---
Public Sub GetUsers()

Dim myolApp As Outlook.Application
Dim myNameSpace As Namespace
Dim myAddrList As AddressList
Dim myAddrEntry As addressEntry
Dim AliasName As String
Dim i As Integer, r As Integer
Dim c As Range
Dim EndRow As Integer, n As Integer
Dim exchUser As Outlook.ExchangeUser

Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myAddrList = myNameSpace.addressLists("Global Address List")

Dim FullName As String, LastName As String, FirstName As String
Dim HomeState As String, PhoneNum As String
Dim StartRow As Integer

EndRow = Cells(Rows.Count, 3).End(xlUp).Row

StartRow = InputBox("At which row should this start?", "Start Row", 2)

For Each c In Range("A" & StartRow & ":A" & CStr(EndRow))
AliasName = LCase(Trim(c))
c = AliasName
Set myAddrEntry = myAddrList.addressEntries(AliasName)
Set exchUser = myAddrEntry.GetExchangeUser

If Not exchUser Is Nothing Then
FirstName = exchUser.FirstName
LastName = exchUser.LastName
HomeState = exchUser.StateOrProvince
PhoneNum = exchUser.BusinessTelephoneNumber

End If

Next c
End Sub
---

Any assistance will be greatly appreciated :)

[SOLVED] Copy from any / specific sheet to my workbook

$
0
0
Hi,
Thanks in advance....
I want to copy data from specific sheet (name has been changed in csv file) of excel workbook to my destination file.
I have got this code on ron de burn site & thankful for the same. But in this code sheet1 is specifically mentioned I want sheet name must be as per my requirement .... is it possible?

Code:

Sub GetData_Example4()
Dim SaveDriveDir As String, MyPath As String
Dim FName As Variant

SaveDriveDir = CurDir
MyPath = Application.DefaultFilePath 'or use "C:\Data"
ChDrive MyPath
ChDir MyPath
FName = Application.GetOpenFilename(filefilter:="Excel Files, *.csv")

If FName = False Then
'do nothing
Else
GetData FName, "Sheet1", "A1:C1", Sheets("Sheet1").Range("A1"), False, False
' I want sheet name choice in this line

ChDrive SaveDriveDir
ChDir SaveDriveDir
End Sub

[SOLVED] Button code to change offset cell in different sheet

$
0
0
Any can help me simplify this code thanks. sorry newbie

I am trying to change the offset file in every cell using a button, but i have bunch off sheet to use to. And my code is so long and having hard time to scroll it down.

Thank you.

Code:

Private Sub CommandButton1_Click()
    Dim barangay As Integer
   
    barangay = Range("B7").Value
'POBLACION
If barangay = 1 Then Range("A4").Value = "=OFFSET(Poblacion!A1,$B$1,0)"
If barangay = 1 Then Range("B4").Value = "=OFFSET(Poblacion!B1,$B$1,0)"
If barangay = 1 Then Range("C4").Value = "=OFFSET(Poblacion!C1,$B$1,0)"
If barangay = 1 Then Range("D4").Value = "=OFFSET(Poblacion!D1,$B$1,0)"
If barangay = 1 Then Range("E4").Value = "=OFFSET(Poblacion!E1,$B$1,0)"
If barangay = 1 Then Range("F4").Value = "=OFFSET(Poblacion!F1,$B$1,0)"
If barangay = 1 Then Range("G4").Value = "=OFFSET(Poblacion!G1,$B$1,0)"
If barangay = 1 Then Range("H4").Value = "=OFFSET(Poblacion!H1,$B$1,0)"
If barangay = 1 Then Range("I4").Value = "=OFFSET(Poblacion!I1,$B$1,0)"
If barangay = 1 Then Range("J4").Value = "=OFFSET(Poblacion!J1,$B$1,0)"
If barangay = 1 Then Range("K4").Value = "=OFFSET(Poblacion!K1,$B$1,0)"
If barangay = 1 Then Range("L4").Value = "=OFFSET(Poblacion!L1,$B$1,0)"
If barangay = 1 Then Range("M4").Value = "=OFFSET(Poblacion!M1,$B$1,0)"
If barangay = 1 Then Range("N4").Value = "=OFFSET(Poblacion!N1,$B$1,0)"
If barangay = 1 Then Range("O4").Value = "=OFFSET(Poblacion!O1,$B$1,0)"
If barangay = 1 Then Range("P4").Value = "=OFFSET(Poblacion!P1,$B$1,0)"
If barangay = 1 Then Range("Q4").Value = "=OFFSET(Poblacion!Q1,$B$1,0)"
If barangay = 1 Then Range("R4").Value = "=OFFSET(Poblacion!R1,$B$1,0)"
If barangay = 1 Then Range("S4").Value = "=OFFSET(Poblacion!S1,$B$1,0)"
If barangay = 1 Then Range("T4").Value = "=OFFSET(Poblacion!T1,$B$1,0)"
If barangay = 1 Then Range("U4").Value = "=OFFSET(Poblacion!U1,$B$1,0)"
If barangay = 1 Then Range("V4").Value = "=OFFSET(Poblacion!V1,$B$1,0)"
If barangay = 1 Then Range("W4").Value = "=OFFSET(Poblacion!W1,$B$1,0)"
If barangay = 1 Then Range("X4").Value = "=OFFSET(Poblacion!X1,$B$1,0)"
If barangay = 1 Then Range("Y4").Value = "=OFFSET(Poblacion!Y1,$B$1,0)"
If barangay = 1 Then Range("Z4").Value = "=OFFSET(Poblacion!Z1,$B$1,0)"
If barangay = 1 Then Range("AA4").Value = "=OFFSET(Poblacion!AA1,$B$1,0)"
If barangay = 1 Then Range("AB4").Value = "=OFFSET(Poblacion!AB1,$B$1,0)"
If barangay = 1 Then Range("AC4").Value = "=OFFSET(Poblacion!AC1,$B$1,0)"
If barangay = 1 Then Range("AD4").Value = "=OFFSET(Poblacion!AD1,$B$1,0)"
If barangay = 1 Then Range("AE4").Value = "=OFFSET(Poblacion!AE1,$B$1,0)"
If barangay = 1 Then Range("AF4").Value = "=OFFSET(Poblacion!AF1,$B$1,0)"
If barangay = 1 Then Range("AG4").Value = "=OFFSET(Poblacion!AG1,$B$1,0)"
If barangay = 1 Then Range("AH4").Value = "=OFFSET(Poblacion!AH1,$B$1,0)"
If barangay = 1 Then Range("AI4").Value = "=OFFSET(Poblacion!AI1,$B$1,0)"
If barangay = 1 Then Range("AJ4").Value = "=OFFSET(Poblacion!AJ1,$B$1,0)"
If barangay = 1 Then Range("AK4").Value = "=OFFSET(Poblacion!AK1,$B$1,0)"
If barangay = 1 Then Range("AL4").Value = "=OFFSET(Poblacion!AL1,$B$1,0)"
If barangay = 1 Then Range("AM4").Value = "=OFFSET(Poblacion!AM1,$B$1,0)"
If barangay = 1 Then Range("AN4").Value = "=OFFSET(Poblacion!AN1,$B$1,0)"
If barangay = 1 Then Range("AO4").Value = "=OFFSET(Poblacion!AO1,$B$1,0)"
If barangay = 1 Then Range("AP4").Value = "=OFFSET(Poblacion!AP1,$B$1,0)"
If barangay = 1 Then Range("AQ4").Value = "=OFFSET(Poblacion!AQ1,$B$1,0)"
If barangay = 1 Then Range("AR4").Value = "=OFFSET(Poblacion!AR1,$B$1,0)"
If barangay = 1 Then Range("AS4").Value = "=OFFSET(Poblacion!AS1,$B$1,0)"

'Binarzang
If barangay = 2 Then Range("A4").Value = "=OFFSET(Binarzang!A1,$B$1,0)"
If barangay = 2 Then Range("B4").Value = "=OFFSET(Binarzang!B1,$B$1,0)"
If barangay = 2 Then Range("C4").Value = "=OFFSET(Binarzang!C1,$B$1,0)"
If barangay = 2 Then Range("D4").Value = "=OFFSET(Binarzang!D1,$B$1,0)"
If barangay = 2 Then Range("E4").Value = "=OFFSET(Binarzang!E1,$B$1,0)"
If barangay = 2 Then Range("F4").Value = "=OFFSET(Binarzang!F1,$B$1,0)"
If barangay = 2 Then Range("G4").Value = "=OFFSET(Binarzang!G1,$B$1,0)"
If barangay = 2 Then Range("H4").Value = "=OFFSET(Binarzang!H1,$B$1,0)"
If barangay = 2 Then Range("I4").Value = "=OFFSET(Binarzang!I1,$B$1,0)"
If barangay = 2 Then Range("J4").Value = "=OFFSET(Binarzang!J1,$B$1,0)"
If barangay = 2 Then Range("K4").Value = "=OFFSET(Binarzang!K1,$B$1,0)"
If barangay = 2 Then Range("L4").Value = "=OFFSET(Binarzang!L1,$B$1,0)"
If barangay = 2 Then Range("M4").Value = "=OFFSET(Binarzang!M1,$B$1,0)"
If barangay = 2 Then Range("N4").Value = "=OFFSET(Binarzang!N1,$B$1,0)"
If barangay = 2 Then Range("O4").Value = "=OFFSET(Binarzang!O1,$B$1,0)"
If barangay = 2 Then Range("P4").Value = "=OFFSET(Binarzang!P1,$B$1,0)"
If barangay = 2 Then Range("Q4").Value = "=OFFSET(Binarzang!Q1,$B$1,0)"
If barangay = 2 Then Range("R4").Value = "=OFFSET(Binarzang!R1,$B$1,0)"
If barangay = 2 Then Range("S4").Value = "=OFFSET(Binarzang!S1,$B$1,0)"
If barangay = 2 Then Range("T4").Value = "=OFFSET(Binarzang!T1,$B$1,0)"
If barangay = 2 Then Range("U4").Value = "=OFFSET(Binarzang!U1,$B$1,0)"
If barangay = 2 Then Range("V4").Value = "=OFFSET(Binarzang!V1,$B$1,0)"
If barangay = 2 Then Range("W4").Value = "=OFFSET(Binarzang!W1,$B$1,0)"
If barangay = 2 Then Range("X4").Value = "=OFFSET(Binarzang!X1,$B$1,0)"
If barangay = 2 Then Range("Y4").Value = "=OFFSET(Binarzang!Y1,$B$1,0)"
If barangay = 2 Then Range("Z4").Value = "=OFFSET(Binarzang!Z1,$B$1,0)"
If barangay = 2 Then Range("AA4").Value = "=OFFSET(Binarzang!AA1,$B$1,0)"
If barangay = 2 Then Range("AB4").Value = "=OFFSET(Binarzang!AB1,$B$1,0)"
If barangay = 2 Then Range("AC4").Value = "=OFFSET(Binarzang!AC1,$B$1,0)"
If barangay = 2 Then Range("AD4").Value = "=OFFSET(Binarzang!AD1,$B$1,0)"
If barangay = 2 Then Range("AE4").Value = "=OFFSET(Binarzang!AE1,$B$1,0)"
If barangay = 2 Then Range("AF4").Value = "=OFFSET(Binarzang!AF1,$B$1,0)"
If barangay = 2 Then Range("AG4").Value = "=OFFSET(Binarzang!AG1,$B$1,0)"
If barangay = 2 Then Range("AH4").Value = "=OFFSET(Binarzang!AH1,$B$1,0)"
If barangay = 2 Then Range("AI4").Value = "=OFFSET(Binarzang!AI1,$B$1,0)"
If barangay = 2 Then Range("AJ4").Value = "=OFFSET(Binarzang!AJ1,$B$1,0)"
If barangay = 2 Then Range("AK4").Value = "=OFFSET(Binarzang!AK1,$B$1,0)"
If barangay = 2 Then Range("AL4").Value = "=OFFSET(Binarzang!AL1,$B$1,0)"
If barangay = 2 Then Range("AM4").Value = "=OFFSET(Binarzang!AM1,$B$1,0)"
If barangay = 2 Then Range("AN4").Value = "=OFFSET(Binarzang!AN1,$B$1,0)"
If barangay = 2 Then Range("AO4").Value = "=OFFSET(Binarzang!AO1,$B$1,0)"
If barangay = 2 Then Range("AP4").Value = "=OFFSET(Binarzang!AP1,$B$1,0)"
If barangay = 2 Then Range("AQ4").Value = "=OFFSET(Binarzang!AQ1,$B$1,0)"
If barangay = 2 Then Range("AR4").Value = "=OFFSET(Binarzang!AR1,$B$1,0)"
If barangay = 2 Then Range("AS4").Value = "=OFFSET(Binarzang!AS1,$B$1,0)"

'Cabaruan
If barangay = 3 Then Range("A4").Value = "=OFFSET(Cabaruan!A1,$B$1,0)"
If barangay = 3 Then Range("B4").Value = "=OFFSET(Cabaruan!B1,$B$1,0)"
If barangay = 3 Then Range("C4").Value = "=OFFSET(Cabaruan!C1,$B$1,0)"
If barangay = 3 Then Range("D4").Value = "=OFFSET(Cabaruan!D1,$B$1,0)"
If barangay = 3 Then Range("E4").Value = "=OFFSET(Cabaruan!E1,$B$1,0)"
If barangay = 3 Then Range("F4").Value = "=OFFSET(Cabaruan!F1,$B$1,0)"
If barangay = 3 Then Range("G4").Value = "=OFFSET(Cabaruan!G1,$B$1,0)"
If barangay = 3 Then Range("H4").Value = "=OFFSET(Cabaruan!H1,$B$1,0)"
If barangay = 3 Then Range("I4").Value = "=OFFSET(Cabaruan!I1,$B$1,0)"
If barangay = 3 Then Range("J4").Value = "=OFFSET(Cabaruan!J1,$B$1,0)"
If barangay = 3 Then Range("K4").Value = "=OFFSET(Cabaruan!K1,$B$1,0)"
If barangay = 3 Then Range("L4").Value = "=OFFSET(Cabaruan!L1,$B$1,0)"
If barangay = 3 Then Range("M4").Value = "=OFFSET(Cabaruan!M1,$B$1,0)"
If barangay = 3 Then Range("N4").Value = "=OFFSET(Cabaruan!N1,$B$1,0)"
If barangay = 3 Then Range("O4").Value = "=OFFSET(Cabaruan!O1,$B$1,0)"
If barangay = 3 Then Range("P4").Value = "=OFFSET(Cabaruan!P1,$B$1,0)"
If barangay = 3 Then Range("Q4").Value = "=OFFSET(Cabaruan!Q1,$B$1,0)"
If barangay = 3 Then Range("R4").Value = "=OFFSET(Cabaruan!R1,$B$1,0)"
If barangay = 3 Then Range("S4").Value = "=OFFSET(Cabaruan!S1,$B$1,0)"
If barangay = 3 Then Range("T4").Value = "=OFFSET(Cabaruan!T1,$B$1,0)"
If barangay = 3 Then Range("U4").Value = "=OFFSET(Cabaruan!U1,$B$1,0)"
If barangay = 3 Then Range("V4").Value = "=OFFSET(Cabaruan!V1,$B$1,0)"
If barangay = 3 Then Range("W4").Value = "=OFFSET(Cabaruan!W1,$B$1,0)"
If barangay = 3 Then Range("X4").Value = "=OFFSET(Cabaruan!X1,$B$1,0)"
If barangay = 3 Then Range("Y4").Value = "=OFFSET(Cabaruan!Y1,$B$1,0)"
If barangay = 3 Then Range("Z4").Value = "=OFFSET(Cabaruan!Z1,$B$1,0)"
If barangay = 3 Then Range("AA4").Value = "=OFFSET(Cabaruan!AA1,$B$1,0)"
If barangay = 3 Then Range("AB4").Value = "=OFFSET(Cabaruan!AB1,$B$1,0)"
If barangay = 3 Then Range("AC4").Value = "=OFFSET(Cabaruan!AC1,$B$1,0)"
If barangay = 3 Then Range("AD4").Value = "=OFFSET(Cabaruan!AD1,$B$1,0)"
If barangay = 3 Then Range("AE4").Value = "=OFFSET(Cabaruan!AE1,$B$1,0)"
If barangay = 3 Then Range("AF4").Value = "=OFFSET(Cabaruan!AF1,$B$1,0)"
If barangay = 3 Then Range("AG4").Value = "=OFFSET(Cabaruan!AG1,$B$1,0)"
If barangay = 3 Then Range("AH4").Value = "=OFFSET(Cabaruan!AH1,$B$1,0)"
If barangay = 3 Then Range("AI4").Value = "=OFFSET(Cabaruan!AI1,$B$1,0)"
If barangay = 3 Then Range("AJ4").Value = "=OFFSET(Cabaruan!AJ1,$B$1,0)"
If barangay = 3 Then Range("AK4").Value = "=OFFSET(Cabaruan!AK1,$B$1,0)"
If barangay = 3 Then Range("AL4").Value = "=OFFSET(Cabaruan!AL1,$B$1,0)"
If barangay = 3 Then Range("AM4").Value = "=OFFSET(Cabaruan!AM1,$B$1,0)"
If barangay = 3 Then Range("AN4").Value = "=OFFSET(Cabaruan!AN1,$B$1,0)"
If barangay = 3 Then Range("AO4").Value = "=OFFSET(Cabaruan!AO1,$B$1,0)"
If barangay = 3 Then Range("AP4").Value = "=OFFSET(Cabaruan!AP1,$B$1,0)"
If barangay = 3 Then Range("AQ4").Value = "=OFFSET(Cabaruan!AQ1,$B$1,0)"
If barangay = 3 Then Range("AR4").Value = "=OFFSET(Cabaruan!AR1,$B$1,0)"
If barangay = 3 Then Range("AS4").Value = "=OFFSET(Cabaruan!AS1,$B$1,0)"


'Camaal
If barangay = 4 Then Range("A4").Value = "=OFFSET(Camaal!A1,$B$1,0)"
If barangay = 4 Then Range("B4").Value = "=OFFSET(Camaal!B1,$B$1,0)"
If barangay = 4 Then Range("C4").Value = "=OFFSET(Camaal!C1,$B$1,0)"
If barangay = 4 Then Range("D4").Value = "=OFFSET(Camaal!D1,$B$1,0)"
If barangay = 4 Then Range("E4").Value = "=OFFSET(Camaal!E1,$B$1,0)"
If barangay = 4 Then Range("F4").Value = "=OFFSET(Camaal!F1,$B$1,0)"
If barangay = 4 Then Range("G4").Value = "=OFFSET(Camaal!G1,$B$1,0)"
If barangay = 4 Then Range("H4").Value = "=OFFSET(Camaal!H1,$B$1,0)"
If barangay = 4 Then Range("I4").Value = "=OFFSET(Camaal!I1,$B$1,0)"
If barangay = 4 Then Range("J4").Value = "=OFFSET(Camaal!J1,$B$1,0)"
If barangay = 4 Then Range("K4").Value = "=OFFSET(Camaal!K1,$B$1,0)"
If barangay = 4 Then Range("L4").Value = "=OFFSET(Camaal!L1,$B$1,0)"
If barangay = 4 Then Range("M4").Value = "=OFFSET(Camaal!M1,$B$1,0)"
If barangay = 4 Then Range("N4").Value = "=OFFSET(Camaal!N1,$B$1,0)"
If barangay = 4 Then Range("O4").Value = "=OFFSET(Camaal!O1,$B$1,0)"
If barangay = 4 Then Range("P4").Value = "=OFFSET(Camaal!P1,$B$1,0)"
If barangay = 4 Then Range("Q4").Value = "=OFFSET(Camaal!Q1,$B$1,0)"
If barangay = 4 Then Range("R4").Value = "=OFFSET(Camaal!R1,$B$1,0)"
If barangay = 4 Then Range("S4").Value = "=OFFSET(Camaal!S1,$B$1,0)"
If barangay = 4 Then Range("T4").Value = "=OFFSET(Camaal!T1,$B$1,0)"
If barangay = 4 Then Range("U4").Value = "=OFFSET(Camaal!U1,$B$1,0)"
If barangay = 4 Then Range("V4").Value = "=OFFSET(Camaal!V1,$B$1,0)"
If barangay = 4 Then Range("W4").Value = "=OFFSET(Camaal!W1,$B$1,0)"
If barangay = 4 Then Range("X4").Value = "=OFFSET(Camaal!X1,$B$1,0)"
If barangay = 4 Then Range("Y4").Value = "=OFFSET(Camaal!Y1,$B$1,0)"
If barangay = 4 Then Range("Z4").Value = "=OFFSET(Camaal!Z1,$B$1,0)"
If barangay = 4 Then Range("AA4").Value = "=OFFSET(Camaal!AA1,$B$1,0)"
If barangay = 4 Then Range("AB4").Value = "=OFFSET(Camaal!AB1,$B$1,0)"
If barangay = 4 Then Range("AC4").Value = "=OFFSET(Camaal!AC1,$B$1,0)"
If barangay = 4 Then Range("AD4").Value = "=OFFSET(Camaal!AD1,$B$1,0)"
If barangay = 4 Then Range("AE4").Value = "=OFFSET(Camaal!AE1,$B$1,0)"
If barangay = 4 Then Range("AF4").Value = "=OFFSET(Camaal!AF1,$B$1,0)"
If barangay = 4 Then Range("AG4").Value = "=OFFSET(Camaal!AG1,$B$1,0)"
If barangay = 4 Then Range("AH4").Value = "=OFFSET(Camaal!AH1,$B$1,0)"
If barangay = 4 Then Range("AI4").Value = "=OFFSET(Camaal!AI1,$B$1,0)"
If barangay = 4 Then Range("AJ4").Value = "=OFFSET(Camaal!AJ1,$B$1,0)"
If barangay = 4 Then Range("AK4").Value = "=OFFSET(Camaal!AK1,$B$1,0)"
If barangay = 4 Then Range("AL4").Value = "=OFFSET(Camaal!AL1,$B$1,0)"
If barangay = 4 Then Range("AM4").Value = "=OFFSET(Camaal!AM1,$B$1,0)"
If barangay = 4 Then Range("AN4").Value = "=OFFSET(Camaal!AN1,$B$1,0)"
If barangay = 4 Then Range("AO4").Value = "=OFFSET(Camaal!AO1,$B$1,0)"
If barangay = 4 Then Range("AP4").Value = "=OFFSET(Camaal!AP1,$B$1,0)"
If barangay = 4 Then Range("AQ4").Value = "=OFFSET(Camaal!AQ1,$B$1,0)"
If barangay = 4 Then Range("AR4").Value = "=OFFSET(Camaal!AR1,$B$1,0)"
If barangay = 4 Then Range("AS4").Value = "=OFFSET(Camaal!AS1,$B$1,0)"



End Sub


Hide Formula inside macro

$
0
0
Hi. i want to hide and lock formula inside a macro worksheet. but after changing the format, the worksheet is lock and cannot use it unless unlocked.
this is the macro
Sub copydata()
Dim lc As Integer
lc = Sheets("Sheet1 (2)").Cells(6, Columns.Count).End(xlToLeft).Column + 1
Sheets("Sheet1").Range("D4:D21").Copy Sheets("Sheet1 (2)").Cells(4, lc)
Sheets("Sheet1").Range("D6:D21").ClearContents
Sheets("Sheet1").Range("D4").ClearContents
End Sub

i have added 2 columns inside sheet1 that uses max and min functions, its this formula i want to hide and lock to prevent from correction or accidentally deleted by user.
which line i have to modify? and how?
totally clueless with macro. i get help by sktneer before
thanks.
by the way, can we lock the sheet name so that it can't be change by the user?
thanks again.

Sumif function returning 0

$
0
0
Hi,

I'm new to VBA and having some difficulty getting a sumif to work within a larger macro. Currently it is returning zeros in column I.

I'm trying to loop this part of the macro so that it runs through a range of criteria one at a time (in column H), identifies matching criteria in column E, and returns the sum of the cells from column C corresponding to column E. I want to place the summed values in Column I, next to their corresponding criteria in column H.

In the below code:
RangeofCriteria = the number of rows in the list of criteria. I would like to essentially conduct a sumif for each of these criteria, hence the loop.

TopRowofCriteria = the row number for the first row in column H for which I would like to conduct a sumif - also the first row where I would like to place the first value in Column I

TopRowofSumRange = the row number for the top row of my matching criteria, also for the sum range
EndRowofSumRange = the row number for the last row of my matching criteria, also for the sum range

Here is the code:

For i = 0 To RangeofCriteria
Cells(TopRowofCriteria + i, "I").Value = Application.WorksheetFunction.sumif(Sheets("Timelog").Range("C" & TopRowofSumRange, "C" & EndRowofSumRange), Sheets("Timelog").Cells(TopRowofCriteria + i, "H").Value, Sheets("Timelog").Range("E" & TopRowofSumRange, "E" & EndRowofSumRange))
Next i

I would really appreciate any help.

Thanks.

Detecting broken hyperlinks

$
0
0
I've searched on here - could not find anything that works for me.

I have a worksheet which contains a listing of hyperlinked cells to local files.

What is the best way of detect broken links to the file (i.e. missing file etc) and to output this to a cell next to the link, i.e. LIVE / DEAD

Many thanks

How can i get this code to work across several rows

$
0
0
Good Morning I have managed to find the code below to replace ":", "/", "+" in text within cells, the code was originally for only one column "A", however I wanted to use across several columns, "F:U" is there a way of doing this please.

Derek.


Code:

Sub replacecol()
row_number = 1
Do
DoEvents
row_number = row_number + 1
    the_description = Sheet2.Range("F" & row_number)
    the_description = replace(the_description, ":", "")
    the_description = replace(the_description, "/", "")
    the_description = replace(the_description, "+", "")
    Sheet2.Range("F" & row_number) = the_description
   
Loop Until row_number = 20

End Sub

How to suppress the display of 'Update' message for files with external links

$
0
0
Hi everyone,

I have a macro below which allows me to extract cell values for all the Excel files in a folder. These Excel files may contain links to other data sources. If I run the macro, then there is a message pop up every time asking me if I want to update external data sources. So I have to click each time for all the files in the folder to dismiss this message which is annoying.

Is there a way to suppress this message? I added the statement but not working: Application.DisplayAlerts = False

Code:

Sub Auto_Open()
    Dim fso, fsoFolder, fsoFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fsoFolder = fso.GetFolder(ActiveWorkbook.Path)

    Application.DisplayAlerts = False


    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    Range("A1").Select
   
    count = 1
    For Each fsoFile In fsoFolder.Files
        strName = fsoFile.Name
   
        If Right(strName, 5) = ".xlsx" And Left(strName, 2) <> "XX" Then
            Cells(count, 1).Value = Left(strName, InStr(strName, "_") - 1)
       
            With GetObject(ActiveWorkbook.Path & "\" & strName)
                Cells(count, 2).Value = .Worksheets("Sheet1").Range("C15").Value
                .Close False
            End With
            count = count + 1
        End If
    Next
End Sub

Macro to record new data as it updates

$
0
0
Hi,

I've attached an example worksheet. I have a horse race on a worksheet with odds from various bookmakers. I'm analyzing a certain bookmaker and what they rank in the market. The rank is in column K. What I'd like to do is when ever a value in any K cell changes it records it in the next column and then the next column if it changes again so I have a history of changes that moves across the page.

Any help would be very much appreciated.
Attached Files

ERROR object variable or with block variable not set

$
0
0
In a userform I have two boxes with dates DEL_BEG AND DEL_END, which are basically a range of dates.

When I click "add" of the userform to add the new record, I made following code to:

- open workbook planning
- find DEL_BEG and DEL_END, merge the specific range and insert certain type of datas.

it works good when the month of DEL_BEG and DEL_END is the same (ex: DEL_BEG = 28-Jun-16 and DEL_END = 30-Jun-16) - here below the code from my userform

Code:

Workbooks.Open Filename:= _
        "C:\Users\mciavaldini.TAMOILCY\Desktop\2016 PLANNING.xlsm"

If Mid(CARGO2016.DEL_BEG.Value, 4, 3) = Mid(CARGO2016.DEL_END.Value, 4, 3) Then

zone = Format(CARGO2016.DEL_BEG.Value, "dd-mmm-yy")
zone1 = Format(CARGO2016.DEL_END.Value, "dd-mmm-yy")

Cells.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate
       

emptyrow2 = Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).row + 1
       
Cells.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate

Cells(emptyrow2, "A").Value = Format(CARGO2016.DEL_BEG.Value, "dd-mmm-yyyy")

Cells(emptyrow2, "B").Value = Format(CARGO2016.DEL_END.Value, "dd-mmm-yyyy")

zonecl = Selection.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Column
       
Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Select
       
zone1cl = Selection.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Column

Set oRange = Range(Cells(emptyrow2, zonecl), Cells(emptyrow2, zone1cl))

oRange.Select

Selection.Merge
ActiveCell.Value = CARGO2016.REF.Value & "(" & CARGO2016.OIC.Value & ") - " & CARGO2016.CT_QTY.Value & "+/-" & Format(CARGO2016.TOLERANCE.Value, "#,##0.00%") & " - " & CARGO2016.GRADE.Value & " - " & CARGO2016.SUPPLIER.Value & "(" & CARGO2016.TERM_P.Value & " - " & CARGO2016.CT_DATES_TERM.Value

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With

End If



But when DEL_BEG and DEL_END does not concern the same month (ex: DEL_BEG = 28-Jun-16 and DEL_END = 02-Jul-16), my code is supposed to:

- open the workbook,

- find DEL_BEG (=zone = 28-Jun-16) and last day of the DEL_BEG month (=zone2 = 30-Jun-16), merge the range and insert some data (here below the code)

Code:

If Mid(CARGO2016.DEL_BEG.Value, 4, 3) <> Mid(CARGO2016.DEL_END.Value, 4, 3) Then

zone = CARGO2016.DEL_BEG.Value
zone2 = Format(WorksheetFunction.EoMonth(CDate(CARGO2016.DEL_BEG.Value), 0), "dd-mmm-yy")

zone1 = CARGO2016.DEL_END.Value
zone3 = Format("01-" & Mid(CARGO2016.DEL_END.Value, 4, 3) & "-" & Right(CARGO2016.DEL_END.Value, 2), "DD-MMM-YY")


Cells.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate

emptyrow2 = Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).row + 1

Cells.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate

Cells(emptyrow2, "A").Value = Format(CARGO2016.DEL_BEG.Value, "dd-mmm-yyyy")
Cells(emptyrow2, "B").Value = zone2

zonecl = Selection.Find(What:=zone, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Column

Cells.Find(What:=zone2, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Select

zone2cl = Selection.Find(What:=zone2, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Column


Set oRange = Range(Cells(emptyrow2, zonecl), Cells(emptyrow2, zone2cl))

oRange.Select

Selection.Merge
ActiveCell.Value = CARGO2016.REF.Value & "(" & CARGO2016.OIC.Value & ") - " & CARGO2016.CT_QTY.Value & "+/-" & Format(CARGO2016.TOLERANCE.Value, "#,##0.00%") & " - " & CARGO2016.GRADE.Value & " - " & CARGO2016.SUPPLIER.Value & "(" & CARGO2016.TERM_P.Value & " - " & CARGO2016.CT_DATES_TERM.Value

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With

- then the code should find DEL_END (=zone1= 02-Jul-16), but if DEL_END is not the 1st day of the month, then it should find the 1st day of the month(=zone3=01-Jul-16), then DEL_END, merge the range bla bla. Here I got a message error "object variable or with block variable not set" in the first "cells.find"

Code:

If zone1 <> zone3 Then

Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate

emptyrow3 = Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).row + 1

Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate

Cells(emptyrow3, "A").Value = zone3
Cells(emptyrow3, "B").Value = zone1

zone3cl = Selection.Find(What:=zone3, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Column

Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Select

zone1cl = Selection.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Column


Set oRange = Range(Cells(emptyrow3, zone3cl), Cells(emptyrow3, zone1cl))

oRange.Select

Selection.Merge
ActiveCell.Value = CARGO2016.REF.Value & "(" & CARGO2016.OIC.Value & ") - " & CARGO2016.CT_QTY.Value & "+/-" & Format(CARGO2016.TOLERANCE.Value, "#,##0.00%") & " - " & CARGO2016.GRADE.Value & " - " & CARGO2016.SUPPLIER.Value & "(" & CARGO2016.TERM_P.Value & " - " & CARGO2016.CT_DATES_TERM.Value

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With

 End If

If zone1 = zone3 Then

Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate

emptyrow3 = Selection.Find(What:="*", After:=ActiveCell, LookIn:=xlValues, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).row + 1

Cells.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate

Cells(emptyrow3, "A").Value = zone1


zone1cl = Selection.Find(What:=zone1, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Column

oRange = Range(emptyrow3, zone1cl)

oRange.Select

ActiveCell.Value = CARGO2016.REF.Value & "(" & CARGO2016.OIC.Value & ") - " & CARGO2016.CT_QTY.Value & "+/-" & Format(CARGO2016.TOLERANCE.Value, "#,##0.00%") & " - " & CARGO2016.GRADE.Value & " - " & CARGO2016.SUPPLIER.Value & "(" & CARGO2016.TERM_P.Value & " - " & CARGO2016.CT_DATES_TERM.Value

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With

End If


End If


can someone explain to me where is the mistake? Here attached the file "planning2016" and the one with userform "example" if it can help.......

Many thanks in advance.
Attached Files

Quotation/Invoice system help! Novice alert!

$
0
0
Can anyone help me as an excel novice trying to learn, using excel 2016? I am trying to build a quotation/invoice system that has all of the works we offer on sheet 1, broken down into columns with column a- item number, b- description of works, c- quantity, d- unit, e- rate, f- amount in £ (there are approximately 200 rows of data). What I would like to do is write a macro that will lift any rows with a value (number or sometimes text) in column c onto sheet 2 so that each quote and subsequent invoice is individually tailored with the same column headings but only the whole rows visible that are relevant for each client’s quote. Does this make sense? Is it possible? Then I'm hoping I can build a sheet 3 with the eventual invoice lifted from sheet 2 with adaptations. Thanks in advance for any help! :)

Run-time error '9': Subscript out of range when trying to create an audit in Excel 2010

$
0
0
I am trying to create an audit sheet in Excel to track changes to the base data.

I have never used Macro before so really am a beginner.

This is the code I found but keep getting Run-time error '9': Subscript out of range

Code:

Dim PreviousValue

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Value <> PreviousValue Then
        Sheets("log").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = _
            Application.UserName & " changed cell " & Target.Address _
            & " from " & PreviousValue & " to " & Target.Value
    End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    PreviousValue = Target.Value
End Sub


The section highlighted as errored is

Code:

        Sheets("log").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = _
            Application.UserName & " changed cell " & Target.Address _
            & " from " & PreviousValue & " to " & Target.Value

I have 2 sheets, the first called OriginalData with my base data with containing the following columns

RecordID
Forename
Surname
UserName
Trade
Session
Attended
Device Swap
ES400 IMEI
Xcover IMEI

The second sheet is called AuditLog is blank

Thanks :)

Open csv in macro

$
0
0
I have a code that will locate the folder then open the csv files one by one and do a certain actions.

First, I already have an existing code, it can locate the file and list down the filename. So I am already good with this.

Code:


Dim xRow, xNum As Long
Dim xDirect$, xFname$, InitialFoldr$, FldPath, file
Dim i As Integer

InitialFoldr$ = Application.ActiveWorkbook.Path
i = 10

Range("C10:F1048576").ClearContents

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = Application.DefaultFilePath & "\"
.Title = "Please select a folder to list Files from"
.InitialFileName = InitialFoldr$
.Show

    If .SelectedItems.Count <> 0 Then
        FldPath = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems.Count
        xDirect$ = .SelectedItems(1) & "\"
        xFname$ = Dir(xDirect$, 7)
        Range("C" & i).Value = 1
       
        Do While xFname$ <> ""
            Range("D" & i).Value = xFname$
            'xRow = xRow + 1
            xFname$ = Dir

            i = i + 1
            Range("C" & i).Formula = "=IF(D" & i & "=" & Chr(34) & Chr(34) & "," & Chr(34) & Chr(34) & ",C" & i - 1 & "+1)"
           
           
            'Call RunCopy2
            'MsgBox xDirect$ & xFname$
        Loop
       
       
       
       
    End If
End With

Second, inside the RunCopy2 code, I need to do the following:
1. Open the first csv file detected
2. When I manually open the file there is an error, so I need to click ok just to open it. So it should bypass, open the file even if there is an error
3. Delete the 2nd row of the opened csv file
4. copy the data from the opened file to a sheet of the tool
5. Repeat steps 1-4 once the action is done


So for now, I just need to code how to open the csv file and disable errors.

How to add column after every header

$
0
0
HI, i would like to know how to add column after very "Brand" column and would like it to be on the "Clean" sheet.
I have about 150 columns and it could be more at other time.


Tried the formula below but it only works on 1 column.

Code:

Sub Insrt()
Dim Found As Range
Dim LR As Long

Sheets("Clean").Select

Set Found = Rows(1).Find(what:="Model Name", LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then Exit Sub
LR = Cells(Rows.Count, Found.Column).End(xlUp).Row
Found.Offset(, 1).EntireColumn.Insert

End Sub

Machine checklist

$
0
0
Hello,

I'm trying to set-up a machine checklist.
But as this machine has a load of options on, I'd like to have the options selectable.
Problem with this is, some options go together and others change when they're selected together.

Code:

Private Sub CheckBox1_Click()
    Sheets("Weight cells").Visible = CheckBox1.Value
End Sub
Private Sub CheckBox2_Click()
    Sheets("Cooling system").Visible = CheckBox2.Value

    If CheckBox2.Value = True Then
        CheckBox5.Value = True
        CheckBox5.Enabled = True
    Else
        CheckBox5.Enabled = True
    End If

    If CheckBox2.Value = True Then
        CheckBox7.Value = True
        CheckBox7.Enabled = True
    Else
        CheckBox7.Enabled = True
    End If

End Sub
Private Sub CheckBox3_Click()
    Sheets("Steam injection").Visible = CheckBox3.Value

    If CheckBox3.Value = True Then
        CheckBox5.Value = True
        CheckBox5.Enabled = True
    Else
        CheckBox5.Enabled = True
    End If
   
    If CheckBox3.Value = True Then
        CheckBox1.Value = True
        CheckBox1.Enabled = True
    Else
        CheckBox1.Enabled = True
    End If

End Sub
Private Sub CheckBox4_Click()
    Sheets("Dosing unit").Visible = CheckBox4.Value
End Sub
Private Sub CheckBox5_Click()
    Sheets("Temperature sensor").Visible = CheckBox5.Value
End Sub
Private Sub CheckBox6_Click()
    Sheets("Exhaust valve vacuum").Visible = CheckBox6.Value
End Sub
Private Sub Checkbox7_Click()
    Sheets("Exhaust tube").Visible = CheckBox7.Value
End Sub
Private Sub Checkbox8_Click()
    Sheets("Exhaust tube cooling+vacuum").Visible = CheckBox8.Value
End Sub
Private Sub Checkbox9_Click()
    Sheets("Vacuum unit").Visible = CheckBox9.Value

    If CheckBox9.Value = True Then
        CheckBox6.Value = True
        CheckBox6.Enabled = True
    Else
        CheckBox6.Enabled = True
    End If

End Sub
Private Sub Checkbox10_Click()
    Sheets("Hinged Lid").Visible = CheckBox10.Value
   
    If CheckBox10.Value = True Then
        CheckBox11.Value = False
        CheckBox11.Enabled = False
    Else
        CheckBox11.Enabled = True
    End If
   
End Sub
Private Sub Checkbox11_Click()
    Sheets("Sliding Lid").Visible = CheckBox11.Value
   
    If CheckBox11.Value = True Then
        CheckBox10.Value = False
        CheckBox10.Enabled = False
    Else
        CheckBox10.Enabled = True
    End If
   
End Sub
Private Sub Checkbox12_Click()
    Dim i As Integer
    For i = 1 To 10
        ActiveSheet.OLEObjects(CheckBox & i).Object.Value = True
    Next i

End Sub
Private Sub Checkbox13_Click()
    Dim i As Integer
    For i = 1 To 12
        ActiveSheet.OLEObjects(CheckBox & i).Object.Value = False
    Next i

End Sub

Weight cells- standalone
Cooling system- Temperature sensor- exhaust tube cooling- Hinged lid or sliding lid
Steam injection- temperature sensor- weight cells- hinged lid or sliding lid
Dosing unit- standalone
Vacuum unit- Exhaust valve vacuum- hinged lid or sliding lid

As for the above, that wasn't much of an issue.
These seem to be working, you can't select hinged lid and sliding lid at the same time.

The hard part (atleast, for me) starts when i'd like to combine Vacuum with the steam injection and cooling system.
This configuration would look something like this:
Vacuum unit- Steam injection- Cooling system- Exhaust tube cooling+vacuum- Hinged lid or sliding lid

Problem is, when i have "cooling system" selected with the "exhaust tube cooling" in the code I can't deselect the exhaust tube and select the "exhaust tube cooling+vacuum" instead, Same goes for the "Vacuum unit" and the "exhaust valve vacuum"


As a last question or sidenote, my "Select all" and Deselect all" buttons do not seem to be working at the moment.
Quote:

Runtime error '1004': Unable to get the OLEObjects property of the worksheet class
Thank you for taking the time in reading this and hopefully help me out!

Rick
Viewing all 49921 articles
Browse latest View live