Hi there
I have written a few macros by recording the actions and all has been good, until now.
I have a table of data which has date and time in column A, room numbers in column B and call type in column C. Column D calculates the time elapsed from the previous call type.
I am trying to do a couple of things which I can happily do manually, but when I record the steps it does not work in the macro.
For example, I want to create a range called Time which is the data in column D and the range need to start at row2 and finish one row below the last row with data in it (ie it needs to be dynamic as this will change each time I copy in data). Manually I would go to cell D2, press Shift-Control-Down (takes me to last entry), then do Shift-Down and then name the range. If I record this, it puts the absolute row number in the macro which is no good.
My other query is that I need to look at column C, find the occurence of a certain call type and then insert an entire row at each occurence. Manually I do this by highlighting column C, press CtrlF, type in the word I am searching for, select find all, scroll to the end of the list that it shows and hold the shift key while highlighting the last entry. Then I close the box, do Ctrl+ and select entire row to insert. Again, recording this action just does not work. It also needs to just let me know if it cannot find any occurences of that call type, rather than giving me an error message.
Apologies if I have not explained this very well but I am a real novice at macros.
Any help would be much appreciated.
I have written a few macros by recording the actions and all has been good, until now.
I have a table of data which has date and time in column A, room numbers in column B and call type in column C. Column D calculates the time elapsed from the previous call type.
I am trying to do a couple of things which I can happily do manually, but when I record the steps it does not work in the macro.
For example, I want to create a range called Time which is the data in column D and the range need to start at row2 and finish one row below the last row with data in it (ie it needs to be dynamic as this will change each time I copy in data). Manually I would go to cell D2, press Shift-Control-Down (takes me to last entry), then do Shift-Down and then name the range. If I record this, it puts the absolute row number in the macro which is no good.
My other query is that I need to look at column C, find the occurence of a certain call type and then insert an entire row at each occurence. Manually I do this by highlighting column C, press CtrlF, type in the word I am searching for, select find all, scroll to the end of the list that it shows and hold the shift key while highlighting the last entry. Then I close the box, do Ctrl+ and select entire row to insert. Again, recording this action just does not work. It also needs to just let me know if it cannot find any occurences of that call type, rather than giving me an error message.
Apologies if I have not explained this very well but I am a real novice at macros.
Any help would be much appreciated.