whenever the active cell is within a given range, highlight the cell on the same row in column S (by changing its interior colour). This should occur each time the active cell is changed, whether by cursor keys or mouse. The effect would be similar to the row and column highlights at left and top of the worksheet.
This action should be restricted to one sheet in the workbook.
I have got stuck on one piece of my code and having trouble fixing... Overall I am trying to find variable station name in cell L2 of Sheet 2 in Sheet 1 and then select and copy the data from the data in "cell L2 of Sheet 2" to the last entry of that row. I have attached an example test spreadsheet of the data and a macro is within Sheet 1 called test1. Please note that cell L2 in Sheet 2 will always be different station name and the station list in Sheet 1 will change with differing station name.
The code I am using is:
The code that is not working and bringing up an error is:
I'm trying to open a file on a network drive...but I'm getting the following error message when it opens: "This file may be read-only, or you may be trying to access a read-only location. Or the server the document is stored on may not be responding." Now, the file itself has no rights restrictions and is not read only. It doesn't appear to be locked.
Now, there are other Excel files in the same directory which I could open fine; however, the Excel documents having the above problem all have a little black icon "appears to be a padlock" (image attached) at the bottom left hand side of the Excel file icon. I tried the following:
- Renaming - Converting to a different file format (didn't work, it won't let me) - Opening in notepad...etc doesn't work.
This file is dated back in 2004...do you think it's corrupt? Is there anything i can do to open or recover this?
For Each C In Sheets("data").Range("A2", Range("A2").End(xlDown)) With C If IsDate(.Value) Then .Offset(0, 3).Value = Format(.Value, "yyyymmdd") Else .Offset(0, 3).Value = Right(.text, 4) End If End With Next C
which is supposed to read the cell offset 3 to the right, and then set to either YYYYMMDD or YYYY depenig on the value in the cell. I'm not sure how to specify the first part of this line - .Offset(0, 3).Value = Format(.Value, "yyyymmdd") - it keeps reading the cell in column A, rather than the offset cel.
I am trying to get a SUM function to recognise values within a range of cells, that are immediately followed by a *. i.e. 34*
For each range i need to count the total number of inputs, count the number of starred inputs & add up all the values entered.
Currently COUNT doesn't recognise starred values, COUNTIF is set to count only starred values, and SUM wont recognise the value of the starred values.
Is there a way to only read the number element of an input - there are only integer values & starred integer values. The starred inputs are also conditionally formatted. If there is a way would it then affect the COUNT/COUNTIF element?
I am trying to program a loop in Excel VBA to read the first two characters of a cell in column A and, depending on the characters returned, to print something else in column B, then move to the next row up. What I have so far below is pieced together from little insights from over the web, but currently it does nothing. Not even error messages. It has more fields (if "XX" > print blah blah) but they are all the same, so only the first two iterations are shown here for clarity.
is it possible to read cell content and use that in a (search)url? somekind of auto-layout or what ever?
i'd have a collumn which has a lot of titles (in different cells), is it possible some way or another to read the content of the different cells and to apply that (in an array?) to an URL?
so use 1 url and add the different cell content as a variable to it? i.e. i'd like to use this url: [url]=[url] for the whole collumn and automatically all new lines that might be added and ,,CELL-INFO'' should be replaced bij the different cell content in the column (Column:A)
2. in sheet 2 I have to import the data from these web sites as it follows from www.datapage.com/source1 starting from cell A1 from www.datapage.com/source2 starting from cell A101 from www.datapage.com/source3 starting from cell A201 etc.
The question: I am trying to write a Macro that tooks the address from sheet 1 cell A1 and import the data through web query using the address in the cell and import it in sheet 2 starting cell A1. Then loop and took the address from cell A1 in Sheet 1 and put it into sheet 2 cell A101 etc.
I have one excel workbook which has 10 rows of data. I need to access another excel wb which has 10 rows of data and get the variance. The key here is wb 1 has the data as I manual gather it and it changes very often. WB 2 also changes to equal the number of rows in Wb 1.
A> I would like to call Wb 2 from Wb 1 and copy those 10 B> It should be able to handle change in the number of rows in WB 2 C> It should be able to call workbook 2 irrespective i name it differently.
I've recently discovered the usefulness of VB in excel and have managed to write some basic macros that enhance many of my workbooks. BUT, I've bumped into a problem I can't seem to solve. Please help!
I'm looking to import the values in a large range of cells ( 5 x 5000) in a closed workbook into a range that i specify in an open one, where both workbooks are housed in the same directory. I also want to include logic that allows me to move the 2 files to different directories (the names will never change, only the paths) and have the code still work--I believe i'd use relative path references?
I've found lots of snippets of code on the topic but can't seem to get any of them to work. For instance: http://spreadsheetpage.com/index.php...a_closed_file/
Problem is, I'm so new that I don't even know where to begin pasting the code (objects vs. modules, etc) in the VBA editor.
I've written a script to read all the values in an excel worksheet in to an array. The cell types differ from General or Text to Custom - HH:MM When I look through the array the script has returned the correct value for most but for the cells that are of a custom type an "incorrect" value has been returned. For example a cell of type Custom HH:MM which is 10:23:00 in the worksheet appears as 0.432638888888889 in the array. Is there a way to get the script to return the correct value? Below is an extract of the code I've used
If objWorksheet.Cells(i, "D") <> "" Then If objWorksheet.Cells(i, "F") <> "" Then arrCULDEV = Split(objWorksheet.Cells(i, "F"), ":") Redim Preserve arrSheetInfo(x) arrSheetInfo(x) = arrCULDEV(0) & "," & arrCULDEV(1) x = x + 1 i = i + 1 Else i = i + 1 End If End If
I have a macro that copies time cells from another sheet and puts them in cells in another sheet, I also have another macro that takes 30 mins away from that time if a certain condition is reached but it wont work unless i retype over the copied cell.
I am in need of a macro that will scan a worksheet row by row, noting the column names (found in I2 to AQ2) in a specific horizontal span of cells (I to AQ) that hold (any) data. The macro will then paste these column names in a designated cell on each corresponding row (always found in column F), separating the column names with commas.
I am trying to do this for multiple worksheets containing ~100 rows - the example attached is just a quick demo of what I'm hoping to achieve. Also, these worksheets are contained in one big workbook, so ideally I'd like to be able to run the macro once and have it apply to every sheet in that workbook (they all have the same layout - the only big difference is the number of rows). If the Total Scenes part at the bottom of the sheet is problematic in getting this to work, it's fine to remove it.
I have a range of amounts in Sheet 1 from F7:Q13 and im using the find method to search for the active and non active values in the cell. Which means that if there's a value in the cell it will transfer the value in Sheet 2, if nothing is found in the cell the cells in Sheet 2 will return as nothing or null.
I think the problem lies on the FindWhat variable. Im getting a compiled error which im not sure what is it.
I've attached the spreadsheet so you get a better idea of the problem that i encountered.
When I copy the tab and change some of the data within the cells, I want the macro refer to the chart on the current tab and the values in the current tab - as currently it refers to only "Chart 2" and the values in the tab 'Figure 2 - WE OPH'.
I've tried changing the sheet name to ActiveSheet.name but that doesn't seem to work.
I have a form that loads and depending on the word selected in the drop down the following code loops through cells Q2:AC2 until it finds the word in one of those cells (the word will always be in one of the cells)
Code: For Each c In Range("Q2:AC2").Cells If c = period Then c.Select
The active cell it finds will always change, i know I need something to code the active cell back but I don't know what it should be.