charlie727
New Member
- Joined
- Aug 3, 2014
- Messages
- 12
Hi,
I have a small query regarding if then Else. I need VBA to read a certain cell and depending on the value run through two different lines of code. I'm having problems getting VBA to read the underlined code. My code below is
Sheets("Sheet2").Select
myFileName = ActiveSheet.Range("a11").Value
ActiveSheet.Range("B33").Activate
If ActiveCell.Value = "DAMS" Or "DAWS" Then
Workbooks.Open Filename:="H:\FINANCIAL SERVICES\Structured Products\Termsheets\FX Accumulator\TS & Notice - Forex Accumulator GTEE LEV_3 DAMSDAWS.xls"
Sheets("TS").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Else
Workbooks.Open Filename:="H:\FINANCIAL SERVICES\Structured Products\Termsheets\FX Accumulator\TS & Notice - Forex Accumulator GTEE LEV_3 WAMSWAWS.xls"
Sheets("TS").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Any help would be much appreciated
Thank you
I have a small query regarding if then Else. I need VBA to read a certain cell and depending on the value run through two different lines of code. I'm having problems getting VBA to read the underlined code. My code below is
Sheets("Sheet2").Select
myFileName = ActiveSheet.Range("a11").Value
ActiveSheet.Range("B33").Activate
If ActiveCell.Value = "DAMS" Or "DAWS" Then
Workbooks.Open Filename:="H:\FINANCIAL SERVICES\Structured Products\Termsheets\FX Accumulator\TS & Notice - Forex Accumulator GTEE LEV_3 DAMSDAWS.xls"
Sheets("TS").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Else
Workbooks.Open Filename:="H:\FINANCIAL SERVICES\Structured Products\Termsheets\FX Accumulator\TS & Notice - Forex Accumulator GTEE LEV_3 WAMSWAWS.xls"
Sheets("TS").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Any help would be much appreciated
Thank you