long

  1. M

    VBA - Copy specific headers help... check point

    Hi Team I got one vba solution on this site given by DanteAmor, if any header missing then I want to add message box for user and exit sub Option Explicit Sub copy_paste_data_based_column_headers() Dim sh1 As Worksheet, sh2 As Worksheet, a() As Variant, b() As Variant Dim i As Long, j...
  2. B

    How to updated statement with PtrSafe keyword

    Hi, I have posted a generic query regarding ‘PtrSafekeyword’ few days ago. However not able to find my post hence posting as new thread. I have below line of code in my macro and am required to update it with ‘PtrSafe keyword’ Private Declare Function GetPrivateProfileStringLib "kernel32"...
  3. A

    Copy rows with data to another workbook

    Hi I have the below code to copy rows with data from one workbook to another ignoring the first two rows as these are header rows however it is only copying column 1. Where am I going wrong? Sub Export_data() Dim ws As Worksheet, wb As Worksheet Set ws = Sheets("Triage") Set wb =...
  4. Johnny Thunder

    VBA Help - Array Loop Won't Populate Cell????

    Hello all, I have a piece of code that creates an Array with my range of data and looks for a value in Column B, if the value equals a Declared string, then Drop a value in column ("O") if not, just grab the value from Column B and drop that in Column ("O"). The logic of the code seems fine...
  5. D

    Table headers being replaced when copying to it from another table

    I have some vba code that copies rows from a table to another table on another sheet. The headers for columns D, F and G on the destination table keep being replaced with column1, column 2 and column 3, instead of being left the as they are. I can't see where it is doing it in the code. Could...
  6. T

    Not seeing the syntax error

    I have the following formula that is giving me a #VALUE ! error and I've been looking at it so long I can't see where the syntax is wrong. Can someone please help? =IF(AND(Y17="Replacement2",Z8<3),"Wave "&'Project Data Sheet'!J73&" Print Order","Wave "&'Project Data Sheet'!B101&" Print...
  7. A

    run time error 9

    Hi I have the below code to copy data from one workbook to another but keep getting a subscript out of range error on the line... Set wb = Workbooks("2019_-_Couriersheet_-_copy.xlsx").Worksheets("Triage2") Both workbooks are open and I've checked the file name is correct etc. What could the...
  8. O

    64 bit issue

    Hi I'm working in 32 bit Excel but I'm getting error in Excel which is 64 bit. How do I edit the codes in 64 bits. Public db As DAO.Database Public rs As DAO.Recordset Public sql As String Declare Function sndPlaySound32 Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _...
  9. M

    Copy/Paste Formulas is multiples of 10 rows causes crash on following calulate

    Hi, I have a macro and part of it involves copying a range of formulas and pasting it down rows while in a loop while updating a progress bar. When I am doing this row by row the macro works perfectly, but when I try to do it in batches of 10 rows the code works fine but when the macro gets to...
  10. A

    CopyPaste copying headers

    I have the below code copying data from multiple worksheets on to a master worksheet without the header row. It works fine if data is entered however if no data is entered on a sheet it copies the header row. How can I change it so that the header row is always ignored even if it is the only...
  11. S

    Formula to copy row A down?

    Hi I need a formula that will copy the data is the first row of AFGIJKLMNOPQR down the sheet, as far down as long as there is data in column C? Can you help?
  12. G

    how to simplify nested if

    this is my formula for IF...
  13. K

    automatic rounded up value

    i am using following vba code to put data from a table in one worksheet into another worksheet, it is working fine except that the value are geting rounded up to nearest integer(37.53 to 38.00).I checked its format too ,it is set for two points after decimal . why is it geting rounded up...
  14. K

    referencing cells from vba

    as shown in code below, i have defined two varible m and n and tried to use these variable for addressing a cell like range("cn") in place of range("c4") during first loop, but it shown run time error 1004 , cant i address a range in this way? Sub test() Dim diameter As Long Dim maxcap As Long...
  15. C

    Issues with assigning value to variable and passing between subs

    I have a form where I gather values from a couple of text boxes. The user can either leave the box blank or enter a whole number typically between 1 and 2000. I'm new to passing values between subs but am trying to learn, so I think this is where my problem may be. As I step through the...
  16. J

    VBA Error 1004 (Global Range Failed)

    Hi, It has been a few years since I have really wrote any substantial amount of macros. This one is a few years old and I am trying to identify the issue and feel like it should be coming to me easier. I am hoping someone else with a little better knowledge base might be able to identify it...
  17. D

    VBA IF THEN with 2 conditions

    Hi All I have this piece of code that is giving me a Runtime error 424 I need it to check every cell in V and every green cell with value 0 it need it to remove its colour, can anyone tell me why I am getting the error. Dim b As Long Dim i as Long Dim D As Range b = 2...
  18. S

    Macro to hide a specific row in column C with the following macro which I want to use to unhide as a toggle

    Hi all, I have a macro which hides all rows in a column within my specific spreadsheet as per the ranges used. I would like to set my macro up to toggle between hiding and then unhiding so need something to reverse the process. The following is the code I have used: Sub HideUnusedRows() Dim...
  19. D

    Object required

    I am getting the object required error with this code: Sub cmdCopy() Dim wsDst As Worksheet, wsSrc As Worksheet, tblrow As ListRow Dim Combo As String, sht As Worksheet, tbl As ListObject Dim lastrow As Long, DocYearName As String, Site As String, lr As Long Dim RowColor As Long...
  20. E

    Automatically update cell.value as long as a ActiveX checkbox is checked - excel 365 on WINDOWS

    C2.value is updated when a button is clicked. My wish is that so long cbox1 is checked O17.value = C2.value Private Sub cbox1_Click() If Me.cbox1.onValue = True Then Sheet1.Range("O17").Value = Sheet1.Range("C2").Value End If End SubWith this code I need everytime click the checkbox...

Some videos you may like

This Week's Hot Topics

Top