zombiemaster
Board Regular
- Joined
- Oct 27, 2009
- Messages
- 245
Hi, All... I haven't been around VBA much the past couple of years, and I'm pretty rusty at this point. Hoping this is an easy answer to get to...
What I have right now is a workbook with multiple sheets: one for each month, then a "Print Sheet" and a "Cover Sheet". My existing code takes the contents of two cells (D9 & D11) from the current row on the Print Sheet and drops that data into two corresponding cells on the Cover Sheet so that page can be printed (which is also done through the code), then those cells clear out until the next time I run the code.
Example:
Sheets("CoverSheet").Range("D9") = .Cells(, 5).Text
Sheets("CoverSheet").Range("D11") = .Cells(, 6).Text
What I need now is this: I have a cell (in the 5th column) in the Print Sheet that can have two different types of values: one that starts with the letter "L" and the other that is numeric-only. If the value is the "L" type, I want my code to put an "X" in cell B5 on the Cover Sheet, and if it's the numeric type, I want the "X" in cell B7.
I'm sure this is just an "if-then" type of situation but as I said, it's been a minute and I'm not sure how to do it.
What I need is something to the effect of:
If the text in the 5th column begins with "L", put an "X" in Sheets(CoverSheet").Range("B5")
If the text in the 5th column begins with a number, put an "X" in Sheets(CoverSheet").Range("B7")
I just don't know how to write that so it works!
Thanks for any help!
-=ZM=-
What I have right now is a workbook with multiple sheets: one for each month, then a "Print Sheet" and a "Cover Sheet". My existing code takes the contents of two cells (D9 & D11) from the current row on the Print Sheet and drops that data into two corresponding cells on the Cover Sheet so that page can be printed (which is also done through the code), then those cells clear out until the next time I run the code.
Example:
Sheets("CoverSheet").Range("D9") = .Cells(, 5).Text
Sheets("CoverSheet").Range("D11") = .Cells(, 6).Text
What I need now is this: I have a cell (in the 5th column) in the Print Sheet that can have two different types of values: one that starts with the letter "L" and the other that is numeric-only. If the value is the "L" type, I want my code to put an "X" in cell B5 on the Cover Sheet, and if it's the numeric type, I want the "X" in cell B7.
I'm sure this is just an "if-then" type of situation but as I said, it's been a minute and I'm not sure how to do it.
What I need is something to the effect of:
If the text in the 5th column begins with "L", put an "X" in Sheets(CoverSheet").Range("B5")
If the text in the 5th column begins with a number, put an "X" in Sheets(CoverSheet").Range("B7")
I just don't know how to write that so it works!
Thanks for any help!
-=ZM=-