vba range

  1. W

    VBA - create new Sheet + fill data in cell based on list

    Hi, I have a VBA script running to add a new Sheet, fill it with a template (TEST Test2) and add the name of the specific employee based on a list. The employee data is located on worksheet RRAV, column K provides the name of the employee. What i want to do is populate cell B3 with the user...
  2. T

    Ever-changing ranges - define based on repeated cell contents

    Hi, This is what I need to happen, imagine these values in column B: Mon 1 Mon 1 Mon 1 Mon 2 Mon 2 Mon 2 Mon 2 Mon 2 Mon 3 Mon 4 Mon 4 Tue 1 I want to be able to identify when the value changes from Mon to Tue and create range definitions I can then use later on...so the resulting range...
  3. C

    How to simulate "End-Right & End-Down" in VBA?

    It seems as if this should be so simple, yet I am having such difficulty! Many thanks in advance for helping me see the simple-solution! I have a table of data in columns A-AD, beginning on row 2, which is the header row. Columns AE-BI contain formulas that I want to copy down to the last row...
  4. E

    User must fill in certain cells from a range before being able to save

    Hi, This is a follow up to a thread I've read here about values being entered into cells before being able to save the excel file. http://www.mrexcel.com/forum/excel-questions/433912-must-fill-cell-before-being-able-save.html The solution here is fine for one cell, but what I am trying to...
  5. H

    VBA sheet name and range

    Hi My question is: I have excel file with 10 sheets with different name. There is a range name "country" can be on any of the 10 sheet. I want vba code to pop-up mesgbox with "excel sheet name" on which range "country" is located thanks in advance...please help
  6. H

    VBA range

    Hi Sub LoopThroughFiles() Dim strFile As String Dim strPath As String strPath = Range("library_location") strFile = Dir(strPath) End Sub my question is how i can get text in range library_location to a string variable so i can mention path from excel and dont have to go...
  7. H

    VBA Range Check

    Hi, I want to write a function which checks that names in the range have range. Countries (USA, UK, Canada, Germany) USA (12, 01, 5) UK (50, 56, 5) Germany (34,09,78) So there are 4 members in range named "countries". and out of 4 members only 3(USA, UK, Germany) has range, Canada didn't had...
  8. H

    Excel VBA Range

    my code is in a below line(runs perfect): Set rngItems = Sheets("Sheet1").Range("Name_List") Problem is, I don't want to go into VBA and change every time, rather I want to do it from Excel window only. I wrote this code but it is giving me error. sheet_loc is a single cell range in excel...
  9. H

    Error 438. Excel VBA cells() = Excel.range()

    I have a code which is giving me error. (It is part of larger code) Dim XData As Excel.Range Dim nRow AS long Dim nCol As long ..... ..... For nRow = 1 To XData.Rows.Count For nCol = 1 To XData.Columns.Count .Cells(nRow, nCol) = XData.Cells(nRow, nCol) When I de-bug code line by line, it...
  10. I

    Storing a range of values and reusing

    Hi, I have a range of dates (that changes in size) so i have been using Dim myrange As Range Set myrange = Worksheets("Ending Unit Output").Range("D1",Selection.End(xlToRight)) How do I store the values of this range so that in another if statement I can simply paste/insert these values. I...
  11. M

    selecting a range in a macro

    Hi, I am trying to select a range in a macro where the first cell position will be returned by a formula. In excel =CELL("address",INDEX(E6:J6,1, MATCH(customer,E6:J6))) would give me $F$6 which is the location of the cell that has customer in it. I am trying to use it in a macro but keep...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top