Search:

Type: Posts; User: Trebor76; Keyword(s):

Page 1 of 6 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    6
    Views
    46

    Re: Why am I getting an overflow error

    You have declared your variable "ref2" as an integer so it can only values in the range -32,768 to 32,767. If the value is outside this you will get the the "overflow error" error message.

    Change...
  2. Re: VBa automatically run macro if cell changes

    Try this event macro (i.e. right click on the tab you want the code to run on and from the short cut menu select View Code and paste the following code) on the sheet in question:


    Option Explicit...
  3. Re: Repeat Values and Range of Dates Based on Cell Values

    Actually try this:


    Option Explicit
    Sub Macro1()

    Dim wsSourceTab As Worksheet
    Dim wsOutputTab As Worksheet
    Dim strMyData() As String
    Dim lngArrayIndex As Long
  4. Re: Repeat Values and Range of Dates Based on Cell Values

    Hmmm...that doesn't answer the question :confused:

    I can't get the dates to copy down properly in any case I'm afraid :( I'm sure someone on the forum will be able though :)
  5. Re: Repeat Values and Range of Dates Based on Cell Values

    So the entered date in cell A1 of the "master sheet" has no bearing on this?
  6. Re: Repeat Values and Range of Dates Based on Cell Values

    So what part does the date in cell A1 of the "master sheet" have in this? Do you only want the data to be copied from the month that's entered in that cell or always for 12 months i.e. if 1-May-2019...
  7. Replies
    4
    Views
    148

    Re: merge sheet vba help

    Thanks for letting us know and you're welcome :)
  8. Re: Copy paste formulas to new sheet (absolute references)

    You're welcome. I'm glad we got it sorted ;)
  9. Re: Repeat Values and Range of Dates Based on Cell Values

    Try this:


    Option Explicit
    Sub Macro1_CopyText_n_Dates()

    Dim wsSourceTab As Worksheet
    Dim wsOutputTab As Worksheet
    Dim bteNumOfDays As Byte
    Dim rngMyCell As Range
  10. Re: VBA code - Insert formula across randomly selected cells

    My original code stops after the initial range has been set (probably a mistake on my part) where yours loops through each cell and sets the formula for that cell.

    If you remove the "Exit For"...
  11. Re: Copy paste formulas to new sheet (absolute references)

    You need to have the sheet name as part of formula even for the sheet it's on (which Excel excludes by default) i.e. in Sheet1 you'd have this:

    =Sheet1!$A$1
  12. Re: VBA code - Insert formula across randomly selected cells

    OK thanks. It just looked like a school assignment which we don't answer directly.

    See how this goes:


    Option Explicit
    Sub CFS_2Q()

    Dim rngMyCell As Range
  13. Re: Copy paste formulas to new sheet (absolute references)

    Hi danhendo888,

    Try "anchoring" the cell references before you copy them - so A1 becomes $A$1 for example. Pressing F2 and then F4 while on the cell with the formula can do this for you.

    HTH
    ...
  14. Re: VBA code - Insert formula across randomly selected cells

    Hi ctillett18,

    Welcome to MrExcel!!

    Can I ask - is this an assignment or work related issue?

    Robert
  15. Re: Repeat Values and Range of Dates Based on Cell Values

    Just noticed I forgot the dates!!

    Try this instead:


    Option Explicit
    Sub Macro1()

    Dim wsSourceTab As Worksheet
    Dim wsOutputTab As Worksheet
  16. Re: Repeat Values and Range of Dates Based on Cell Values

    Hi Jon,

    Try this (note my comments as well):


    Option Explicit
    Sub Macro1()

    Dim wsSourceTab As Worksheet
    Dim wsOutputTab As Worksheet
  17. Replies
    4
    Views
    148

    Re: merge sheet vba help

    Hi Dan88,

    Try this:


    Option Explicit
    Sub merge()

    Dim wrk As Workbook
    Dim sht As Worksheet
  18. Replies
    3
    Views
    82

    Re: Return Positive Value of SUMIF

    Or:

    =SUMIF(U5:U91,"2",N5:N91)*-1

    Note though that these will reverse the total so if it happens to be positive it will return a negative. Depends what the OP really wants I suppose.
  19. Replies
    3
    Views
    82

    Re: Return Positive Value of SUMIF

    Hi jmattingly85,

    Try this:

    =ABS(SUMIF(U5:U91,"2",N5:N91))

    Regards,

    Robert
  20. Re: Help with vba to sum cells and also subtract cells

    Thanks for letting us know and you're welcome :)
  21. Re: Help with vba to sum cells and also subtract cells

    So this will put the desired results from your original request in cells F4:H4 whenever there's a change in C5:C105001 or G5:G105001:


    Option Explicit
    Private Sub Worksheet_Change(ByVal Target...
  22. Re: Help with vba to sum cells and also subtract cells

    For Col. G I take it the data starts at Row 6? You can't have =SUM(G5:G105001) in cell G5.
  23. Re: Help with vba to sum cells and also subtract cells

    How is Row 105001 determined? Also the value for cell G5 will have to be from a formula starting form cell G6 or else there will be a circular reference.



    No idea what you mean??
  24. Re: Help with vba to sum cells and also subtract cells

    Why would you want the same formula to be placed in the cells whenever a cell is changed as the answer will always be the same?

    What do you mean "places the code" in those cells? The code will...
  25. Re: Help with vba to sum cells and also subtract cells

    Hi Gregm66,

    Try this:


    Option Explicit
    Sub Macro1()

    With Sheets("Club Ledger")
    .Range("F5").Formula = "=SUM(C5:C105001)"
Results 1 to 25 of 150
Page 1 of 6 1 2 3 4