range and macro

  1. I

    Help with using a formula to define the selected range in VBA

    Hello, I would like to do something like this: Range("=CELL(""address"",INDEX(INDIRECT(R2C12),3,2))").Select ActiveCell.FormulaR1C1 = "=CELL(""address"",INDEX(INDIRECT(R2C12),3,2))" will put the formula into the currently active cell, but I can't get the VBA to select a range based off the...
  2. C

    How do I add a range to a Worksheet change event?

    The following code adds a comment to any cell that has been been change. However, right now it applies to the entire worksheet. Is there a way I can limit the target to a specified range? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Comment Is Nothing...
  3. E

    get the data from a filtered table.

    With the folowwing code, I try to walk trough the filterd rows of a table: Sub GetConfigDataLists() Dim xRange As Range Set xRange = Sheets("config").ListObjects("config_table").DataBodyRange xRange.AutoFilter 1, "Lists" xRange.Select For Each Row In xRange 'Try to read in a...
  4. D

    Using range with cells (copying columns) - Error message

    Hi, I want to create add sheets copying some columns from a "master" sheet using the range command. I am having an issue with a Error 1004 "Application-defined or Object-defined error" when selecting a range using a cell format. I would like to use cells so I coud have the columns in a...
  5. K

    TextToColumns for cells not containing spaces without overwriting cells already split before.

    I wished I was better in VBA because I've been searching how to solve this problem since last friday. I'm hoping you guys can help me out or put me in the right direction. Basically what I need is to find a way to Text-To-Columns, in a fixed range, but only for cells that contain spaces. I...
  6. I

    runtime error '1004 'Range of object _Global failed

    Hi all of a sudden i am getting this error "runtime error '1004 'Range of object _Global failed". earlier this used be working fine, dont know what happend as i am new to VBA. when i debug this i am getting this error at the following code Range(rcout & outcolml & 1) = Range("'heads'!" &...
  7. B

    Hide Row on Column and Cell Based evaluation

    I have a spreadsheet with a list of questions. Only a portion of these questions will be applicable in any given scenario so I'd like to have a macro to hide the rows of questions that are not applicable. Let's call this sheet("Questions") I have a separate sheet where someone enters...
  8. V

    Updating a dynamic range for a chart

    I am trying to have a excel chart that would be controled by a scollbar and combobox I have an existing chart with dynamic ranges so for example dataSetA is defined as <code style="margin: 0px; padding: 0px; border: 0px; font-size: 13.63636302947998px; vertical-align: baseline; font-family...
  9. B

    VBA if then applicable on range

    Hi all, Im quit a noob when it comes to ranges in VBA. I have a code that needs to applied to a range if possible, rather than entering the code I have multiple times. When cell I13 has a certain text value, J13 must be mandatory. if J13 is not filled in, a messagebox appears. on the other...
  10. S

    How to make a Formula Dynamic

    Hello everybody, How do i make this fomula dynamic? It is selecting a range of columns The number of end columns keep on changing (increases daily) i.e. "=IFERROR(AVERAGEIFS(RC11:RC172....here 172 will change to some other column but C11 will be constant Formula: ActiveCell.FormulaR1C1 = _...
  11. D

    Update Chart Filters Based on Range In Spreadsheet

    Objective: to use a list of items in a specified range to update a pivot chart I know the code below points to what I am needing, but I think I need to create a variable to step through a range so that I can add them to the code below: (something like Range = Sheets("Main").Range("A1:A10") for...
  12. D

    Importing data matching named range

    Hi everyone out there in Excel help land. After a hard day trying and failing to get some-where with some VBA code I was hoping for some advice. My VBA coding ability is intermediate at best and in a previous life I used to get by simply walking across the office to troubleshoot with some...
  13. R

    VBA - Determine first and last row in range in order to calculate correlation

    Hi guys, I'm currently using Excel 2010 on windows 7. My issue is I have a sheet filled with data that has random separations (empty rows) for which I need to calculate correlations of the data in between the empty rows. For example I have data filling the range of D6:AA657 but with empty rows...
  14. R

    Selecting a target column in vba

    Hi guys, I'm having a little trouble with a bit of code. I don't really know much vba, and I usually manipulate existing code to do what I need. This bit of code has me stumped and I can't find anything similar. At the moment I'm trying to record changes to my worksheet when someone modifies...
  15. E

    Hide and Unhide Rows Macro

    May I post this one query I am having regarding hiding and unhiding rows. I have the following code to hide and unhide row 5-34. I attached the macro to one button. My problem is I sometimes needed to insert row/s between 5-34. How do I make my code flexible that it will adjust the number of...
  16. N

    Copy and Paste Plain Text into new Workbook

    I have a range of cells from A1 to D?? (Anywhere from 10-100) in which contains a bunch of formulas. I need to create a macro which copies and pastes (As plain text and not the formulas) the range of active cells into a new workbook. The column D may contain Blank Cells. How can i define the...
  17. M

    Copy multiple columns to new wb and different columns

    Hi Guys, I need help witth regards to this. I've tried this with just 1 column only. But now, I have to copy and paste multiple columns. Public Sub RunMe() Dim i As Long Dim WB1 As Workbook Dim WB2 As Workbook Dim strFile1, strFile2 As String Dim strCol1, strCol2...
  18. 3

    VeryHide and Unhide by one click with dynamic range

    Hey All,</SPAN> I came to a fancy idea, but I got stuck while trying to get it together. The basic problem is I would hide columns or rows or sheets with one click, and with another button I would like to unhide them. But when I hide one it should be Veryhidden, so that other users cant reveal...
  19. I

    Replace range name in a formula for range

    Hi there I'm trying to change a range in a formula, from =COUNTA(range_name) To =COUNTA(D2:D10) Any ideas on how to do this? My macro first named some ranges but then I need to have just the ranges. THX!!
  20. F

    check format

    Hi, normalny in the column "M" I have data format (ex. 25.05.2013 12:10:55), but sometime the values are difrent: -628022.9725 or -623275.021412037 Now I want to remove all the values wrong values. I have something like: With sourceWb.Sheets(1) LastRow =...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top