wks

  1. X

    vba

    Hello I have a VBA in a spreadsheet so that all data i enter aligns to the top and left. However when I copy over data from another spreadsheet it seems to override the vba formatting any ideas? Thank you. Sub Stuff() Dim wks As Worksheet For Each wks In Worksheets...
  2. J

    how to retrieved my data in worksheet to my combo box ??

    i call pesat to my button Private Sub pesat() Dim wks As Worksheet Set wks = Sheet9 pesatcb.Text = wks.Range("BH3").Value End Sub Private Sub pesatcb_Change() Dim wks As Worksheet Dim addnew As Range Set wks = Sheet9 Set addnew =...
  3. A

    How to Reference ONE cell from ALL Pivot Tables in a Workbook - VBA

    Excel friends, The code wks.Range(rngAddress).Activate is not working. It generates a runtime error 91. Can somebody help me. Thanks! Sub PivotTableMacro() Dim wks As Worksheet Dim wb As Workbook Set wb = ActiveWorkbook Dim pt As PivotTable Dim rngAddress As Range For Each wks In wb.Sheets...
  4. J

    Paste Only Values

    Below code copies a range of cells from multiple cells in a workbook to a Master Sheet however, I need it to copy only the values and not the formulas. I've tried a few things like CopyRng.Copy With DestSh.Cells(Last + 1, "A") .PasteSpecial xlPasteValues .PasteSpecial...
  5. M

    Why aren't my newly inserted columns being populated with the Formula?

    Hey guys! First the code: Sub MyInsertColumn() Dim wks As Worksheet Dim i As Long Dim Lastrow As Long Application.ScreenUpdating = False Lastrow = Range("A" & Rows.Count).End(xlUp).Row For Each wks In ActiveWindow.SelectedSheets With wks For i =...
  6. B

    Apply different formulas across multiple sheets

    Hi, I have a macro that is creating sheets and adding fomula to "ABSTRACT" sheet. i have 4 sheets in my workbook ( Product1 ) ( Product2 ) ( Product3 ) AND ( ABSTRACT ) only( Product 1 ) sheet =>some of the cells are linked to abstract sheet(which is fullfilled my requirement) there are 2...
  7. avisoft20

    Export every sheet like .pdf with its own name

    Hi, I am trying to create pdf from excel workbook.but pdf will save with their own name..i have multiple sheet in a single workbook Example: sheet1-Jan sheet2-feb sheet3-march I wana to save all .pdf in same directory. jan.pdf feb.pdf march.pdf I am using this VBA code : Option Explicit Sub...
  8. J

    Clearing all unlocked cells on every sheet in a workbook.

    I have 3 bits of code in the PERSONAL workbook (hidden on start). First two bits unprotect and protect all worksheets. I have a work book with one tab for every day of the Quarter. On the code I got for clearing all unprotected/unlocked cells it's acting like it's not even running. Is it...
  9. Pinaceous

    VBA Column Size

    Hi All, I'm working with this code to make all worksheets of a workbook with columns A, B & C a specific size. Sub ColumnPrep() ' Dim wks As Worksheet Application.ScreenUpdating = False For Each wks In Worksheets wks.Activate Range("A:A").Activate...
  10. B

    VBA for randomizer

    Hello guys I have the following code made to be a randomizer, however is not giving me the proper results that I expected, here are the results needed 1- It doesn't matter which manager name do you put it always give you the same data no matter how many rows you have on the raw data 2- Also I...
  11. M

    VBA to sort by color - need a quick tweak

    Hi All, I am working through this code to sort my data by color ... then delete the rows of that color. The below code works to sort but my table starts in row 5 and the code overrides it and starts the sort in row 2. Can anyone help adjust this code or have a better way to approach this...
  12. A

    Excel Macro to update sheet values on another sheet where it find a match

    Hi I am using this macro to update two rows on another sheet by finding the matching cell. Sub findcode1() Dim wks As Worksheet Dim wks2 As Worksheet Dim myR As Range Set wks = Worksheets("Voorraad") Set wks2 = Worksheets("Koop") If...
  13. X

    Unhide Specific Sheets via Display Box Input

    I have a workbook with quite a few sheets and want to have a text box that displays and asks to enter a text, then the macro will unhide all sheets with that text in it. For instance, if I have sheet names - Work1, Work2, Work3, Data1, Data2, Data3, and only Work1 and Data1 sheets are visable, I...
  14. JackDanIce

    Run-time error '1004', unclear why

    Hi, Using following code to return last used row number and receiving 1004 run-time error, wks is an object: Public Function LastRow(ByRef wks As Worksheet, Optional ByRef xCol As Long = 0) As Long 'Returns row number of last used cell on a specified sheet in an optional column (A if not...
  15. R

    Worksheet reference issue?

    I have a macro that should run but I am linking it to cell N14 for the file name and cell N16 for the Worksheet tab name. I cannot get this macro to run and it stops where I reference the worksheet name in cell N16. If someone could look at this and possibly assist me, I would appreciate it...
  16. JackDanIce

    Last Row: Subscript out of Range error

    Hi, Have function to find last row on a specified column and sheet but decided to use code from Ron De Bruin aka: Public Function LastRow(ByRef wks As Worksheet, Optional ByRef xCol As Long = 1) As Long With wks '#1 LastRow = .Cells(.Rows.Count, xCol).End(xlUp).Row...
  17. JenniferMurphy

    Conditional format on text field?

    I have a column of text values representing the number of weeks remaining before some deadline. <tbody> Lead Time 25 Wks 28 Wks 30 Wks 18 Wks 35 Wks 3 Wks 27 Wks 38 Wks </tbody> I would like like to highlight (fill color) the cells depending on the value. For example...
  18. J

    Print Macro

    Sub test()Dim rng As Range Dim wks As Worksheet For Each rng In Sheets("Dropdowns").Range("B12:B29") If Trim(rng.Value) <> "" Then On Error Resume Next Set wks = Nothing Set wks = Sheets(rng.Value) On Error GoTo 0 If wks Is Nothing Then...
  19. S

    Reference One Sheet on clear data Sub

    Hello, I have a sheet I've been working on for some time that is a work sheet for pricing quotes. I lock all the cells on the sheet except the ones needed to input data to keep all of my formulas safe. I added a clear Sheet button using code I got from this forum so that users could easily...
  20. J

    How rename worksheet CodeName at runtime?

    Hi I have a form with a combobox that contains 1,2,3,4 I need to create a work worksheet at Runtime and assign it the following properties. Name = "Week" & the value of combobox CodeName = "wks"& Worksheet name I get a compile error on the CodeName ( Can't assign to read only property) Here is...

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