bobbythefish
Technical User
I am trying to copy/paste special (to overwrite embedded conditional) a range of cell in one worksheet, based upon a variable in a sheet from another book. Any suggestions?
thanks
bobby
thanks
bobby
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Const BOOK_BFOPTIONS = "BF-Auto-options.xls"
Const BOOK_ALL = "ALL-Options.xls"
Const SHEET_BFOPTIONS = "OPT-SHEET"
Const SHEET_HOLDINGS = "sheet4"
Const SHEET_STRIKES = "strikes"
Const ROW_ACCOUNTLIST = 4
Const ROW_FIRSTTICKER = 7
Const ROW_MAXROWS = 33
Const ROW_POSTSTRIKES = 5
Const COL_TICKERS = 2
'Column "B"
Const COL_PRICES = 8
'Column "H"
Const ROW_COPYFROM = 7
Const ROW_COPYTO = 5
Const ROWS_TO_CLEAR = 26
Const COLS_TO_CLEAR = 2
Const CELL_ACCOUNTID = "Y42"
Const CELLS_LOOKUP = "$A4:$IV4"
G1: =MATCH(Y42,INDIRECT(H1&"$4:$4"),0)
H1: ="'["&Y42&".xls"&"]sheet1'!"
B7: =INDEX(INDIRECT($H$1&"A4:IV999"),CELL("row",B7)-5,$G$1)
Option Explicit
Const ACCOUNT_KEY = "$E$1"
Const ACCOUNT_NUMBER = "$Y$42"
Dim gsLastBook As String
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = ACCOUNT_KEY Then
Application.ScreenUpdating = False
On Error Resume Next
Windows(gsLastBook).Close
gsLastBook = Range(ACCOUNT_NUMBER) & ".xls"
Workbooks.Open gsLastBook
Target.Worksheet.Activate
Application.ScreenUpdating = True
End If
End Sub