Teladianium
New Member
- Joined
- Apr 10, 2012
- Messages
- 15
Hi all,
I can only find help on "IF" statements for formulas in Excel help. And I don't think I m asking the correct question to google. so a am hoping I can find it here. I think it will be a silly thing on my part I'm sure. but my IF changes the active cell to "TRUE" when running. I do not wish it to do so as the active cell is critical data. I tried to use the XL2BB but it keeps crashing for some reason. but it's just a data input screen, nothing special (copy & Pasted it at the bottom just for reference) Here is my code. It's intended to check the "Sample nature" column to see if it's a "BHS Sample" and do nothing/skip if it is. and call the "Createsheet" sub if not. then go to the next line and repeat. Thanks in advance, much appreciated.
Sub SurfaceSampleDataSheet()
Dim BHSTest
BHSTest = ActiveCell.Offset(21, 0).Value
Do Until ActiveCell = "Version 3.1"
BHSTest = ActiveCell.Offset(21, 0).Value
If BHSTest <> "BHS Samples" Then
Call CreateDataSheet
End If
ActiveCell = ActiveCell.Offset(1, 0).Select
Loop
End Sub
I can only find help on "IF" statements for formulas in Excel help. And I don't think I m asking the correct question to google. so a am hoping I can find it here. I think it will be a silly thing on my part I'm sure. but my IF changes the active cell to "TRUE" when running. I do not wish it to do so as the active cell is critical data. I tried to use the XL2BB but it keeps crashing for some reason. but it's just a data input screen, nothing special (copy & Pasted it at the bottom just for reference) Here is my code. It's intended to check the "Sample nature" column to see if it's a "BHS Sample" and do nothing/skip if it is. and call the "Createsheet" sub if not. then go to the next line and repeat. Thanks in advance, much appreciated.
Sub SurfaceSampleDataSheet()
Dim BHSTest
BHSTest = ActiveCell.Offset(21, 0).Value
Do Until ActiveCell = "Version 3.1"
BHSTest = ActiveCell.Offset(21, 0).Value
If BHSTest <> "BHS Samples" Then
Call CreateDataSheet
End If
ActiveCell = ActiveCell.Offset(1, 0).Select
Loop
End Sub
No | Date | Time | Sample Nature | Sampler |
Type | ||||
DST_2.01 | 11-Dec-22 | 12:00 | Brine | N/A |
TRUE | 14-Dec-22 | 18:20 | Water | N/A |
TRUE | 15-Dec-22 | 1:00 | BHS Samples | N/A |
TRUE | 15-Dec-22 | 3:00 | Water | N/A |