I am writing a macro to preform processes on an excel spreadsheet. I'm trying to use the file name string to input into cells. I have tried the following code:
Code:
MyName = ThisWorkbook.Name
The workbook I am working out of is called "2008 02.xlsx", but when I run this code the variable "MyName" returns "PERSONAL.X LS". It my be something about the version of excel I am using (2003 version)....
Thank you ADezii. That gave me what I needed to work with. The code I used was this:
Code:
'find the last row in the "A" column
numberofrows = Range("A65536").End(xlUp).Row
'write a for statement to iterate through every row except for the column header row (A1)
For h = 2 To numberofrows
'Use my iteration variable "h" to search through the text in each cell
Cells(h, 1).Select
I am trying to take a string (specifically one in the format "2008-09-01 00:00") and write an if statement to perform a process if the value to the right of the rightmost colon is anything but "00"
I have extracted the text from the cell using the code:
Code:
For h = 2 To NumberOfRows
Cells(h, 1).Select
Dim v As Variant
Mytext = Cells(h, 1).Text
Leave a comment: