I have some numbers in a column that I need to copy 12 times (each one) into another column. The problem is that I got like 200 records that will be converted in 15000 aprox. I've uploaded an example of what I need,
I would like to add a command to my macro that will do one simple step: Refresh all FDS Codes
FDS I believe is short for FactSet Data Series. FactSet is an add-in for excel we use at work. The FactSet menu button is in my ribbon and when I choose that add-in, there are a number of actions I can execute. One is to refresh all FDS which is to refresh all cells with formulas that pull in data from our FactSet database.
I tried recording this action but VBA does not show any key strokes from those steps so I think I just experienced one of the many shortfalls of recording macros. Is there a way to write the macro to execute this action? I would think since I am using a FactSet add-in, it would be possible but I don't know where to begin.
I am trying to increment a row when i copy it across columns. I have searched for a couple hours on how to do this, but I have not come up with a solution that I can understand that works for my situation.
I found this page, but I guess I am too novice to comprehend it. [url]
I would like the number in this formula to increment when i copy it to the adjacent column.
I am creating a spreadsheet which creates a bulk of data from a front sheet.
The question is: Is there a way to automatically copy a fixed formula for 100 cells using one fixed cell reference such as $A$1 and then automatically after 100 cells replace $A$1 with $A$2, after another 100 with $A$3 and so on?
Explanation with Example:
For example, Sheet1 contains the words "Green Tree" in Cell A1 and Sheet2 will then place "Green Tree" into 100 different sentences such as:
Plant a Green Tree Grow a Green Tree today
This would be created with the formula ="Grow a "&'Sheet1'!$A$1& " today"
After 100 different variations using the formula I want to change that formula to reference cell A2 on Sheet1.
I know if I place "Red Tree" in Cell A2 and use the formula ="Grow a "&'Sheet1'!$A$2& " today" I can do this manually using find and replace for the 100 cells, but I want to do this for 100 different variations of Green Tree to create a 10,000 different sentences so I'd need to find and replace 100 times!
I have this very simple code below that I use to delete a row if its marked as 'false' in column M. This works quite well, but I want to expand it. I use this in a workbook that can have name different sheet names in a month, and I want it to automatically go through all the sheets and do this...except for 2 sheets named addressess and sheet1. Is there something I can add to this macro that will loop through all the other sheet names (regardless of name) and execute this?
Sub DelRow() With ActiveSheet .AutoFilterMode = False With Range("m1", Range("m" & Rows.Count).End(xlUp)) .AutoFilter 1, "false" On Error Resume Next .Offset(1).SpecialCells(12).EntireRow.Delete End With .AutoFilterMode = False End With End Sub
Is it possible to loop through a list of sheets and execute some calculations that have sheet references from a different list of worksheets? For example, you have a list (list 1) of your worksheets, which will be the destinations of the calculations, and you have a second list (list 2) of worksheets that the calculations are based on. So, lets say there are sheet1 and sheet2 in list 1, and sheetA and sheetB in list 2. The calculations based on sheetA would appear in sheet1, and calculations based on sheetB would appear in sheet2. I thought the code would look something like this:
Code: Sub LoopthroughWorksheets() Dim sheet_name As Range Dim sheet_name2 As Range Set sheet_name2 = Sheets("WS").Range("F:F")
I'm getting a "Run-time error '1004: Application-defined or object defined error" at this line:
I am experimenting one way to solve one problem, but to do this I have to Name some cells with some values, thing that normaly in VBA is symple but I have never done before in coding. May be my problem is because what I am doing is not valid with the vlookup but if you can take a look to my file. The problem is that when I run the Macros the Named Cells are totaly out of place...
Sub Lookup() dercell_unit = Range("C65500").End(xlUp).Row Range("B" & dercell_unit, "E2").Select Set Rango = Range("B" & dercell_unit, "E2") For i = 2 To dercell_unit Names.Add "VALrsa", "=$C" & i Names.Add "RESOLdds", "=$D" & i Cells(i, 7) = Application.VLookup(Cells(i, 2), Rango, 4, False) Next i End Sub
I try to select a range with a counter, but cannot find how to do it. My aim is in the following loop to select the range ("B,i:V,i"). B and V are the colum, i is the counter that marks the row number, counting from 8 to 16.
For i = 8 To 16 Sheets("DB2").Select If Cells(i, 7).Value <> 0 Then Sheets("DB3").Select i = i - 1
'this is the cell that should be a range ("B8:V8") to ("B16:V16"), as the counter goes from 8 to 16
i = i + 1 Selection.Copy Cells(i, 2).Select ActiveSheet.Paste Application.CutCopyMode = False
Else End If Next i End Sub the Sub works with a cell, can somebody please tell me how to turn the cell in the range?
I'm trying to use the following loop to increment the column width of a range of columns thus:
Code: NewWidth = 0 WidthIncrement = 0.5 For MyCount = 1 To 26 NewWidth = NewWidth + WidthIncrement Cells(1, MyCount).EntireColumn.ColumnWidth = NewWidth Next
If I set WidthIncrement to be an integer value, the code works correctly. If, however, I make it something like 0.1, all the column widths that the loop acts on are set to 0. I suspect it's something to do with how I'm declaring the NewWidth and WidthIncrement variables - they're currently set to Double. I know that I can have decimal values for column widths (e.g. 8.43)
There are 2 buttons on my worksheet below each other. Each button has a size of a range (i.e. "G33:G34", "G36:G37").
This is what I would like to do: 1. Click on the first button 2. Copy A33:F42 and insert them below row 33 3. Move the buttons to the same position (10 rows down) on the sheet 4. Copy the existing buttons and put them in their original space (i.e. "G33:G34", "G36:G37") 5. Do it as many times as I click on the first button
I have this, and I have no idea to the remaining part...
Private Sub CommandButton1_Click() Range("A33:F42").Select Selection.Copy Rows("33:33").Select Selection.Insert Shift:=xlDown Application.CutCopyMode = False Range("B33:B42").Select End Sub
I have a large data file with several different worksheets. In one cell I have a large set of individual numbers (i.e in the cell there is "123456 234234 939829") This value is my 'sample' number. The same sample could be in multiple rows on one sheet and could also be on other sheets. I am trying to find the sample in a column (on some sheets its column "Q", other sheets it could be different columns, but that column is fixed per sheet) and then copy the information on the same row in columns A & B and copy it to my target sheet. Then the next place the sample appears copy that info to the next row of my target sheet. So far I am stuck getting it to find the multiple values on one sheet. My code is below.
Sub Samplesearch() Dim sample As String Dim x As Integer Dim y As Integer Dim lr As Long Dim lsr As Long