Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change code by code. Can you do that?
LastCell = Worksheets("Main").Cells(Rows.Count, "B").End(xlUp).Row ' CHANGE COLUMN (B) TO (D) FOR
YEAR-2008 With the above line of code, If the date which is input (Now, Format "mmmm yy") into sheet1.range("C16") when the workbook opens the year changes from 2007 to 2008, then the above code line "B" changes to "D". Can vb do this? Corey..... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change code by code. Can you do that?
iYr = Year(Sheets("Sheet1").Range("C16")
If iYr = 2007 Then aCol = "B" If iYr = 2008 Then aCol = "D" LastCell = Worksheets("Main").Cells(Rows.Count, aCol).End(xlUp).Row Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change code by code. Can you do that?
Thank you Merjet
"merjet" wrote in message oups.com... iYr = Year(Sheets("Sheet1").Range("C16") If iYr = 2007 Then aCol = "B" If iYr = 2008 Then aCol = "D" LastCell = Worksheets("Main").Cells(Rows.Count, aCol).End(xlUp).Row Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change this code? | Excel Discussion (Misc queries) | |||
Can I use code/macro to change code/macro in an existing file? | Excel Programming | |||
change code | Excel Programming | |||
Code Conflicts With Worksheet Change Code | Excel Programming | |||
VB CODE RUN ON DDE VALUE CHANGE | Excel Programming |