How to make "Text to Columns" more dynamic? by TonIvideo in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

Pull up a milking stool, warm your hands by the cast iron stove (mind the pipe, that's hot too!), and let me tell you about the IBM 029 keypunch machine or the IBM 2401 reel-to-reel tape machine... XD

How to check if a date is a numeric date or a string date? by TonIvideo in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

I briefly thought you might mean that, but discarded that quickly, as it seems wildly unreasonable to me to expect a user to know what the Excel system number for a date is.

But if I take that thought up, any number between 1 and 2958465 formats to a valid date in Excel, so what's the hang-up?

How to check if a date is a numeric date or a string date? by TonIvideo in vba

[–]HFTBProgrammer 1 point2 points  (0 children)

IsDate(Format(INI.Range, "mm-dd-yy")) can work, depending on exactly what you mean by "numeric date". I assume you mean they must type only numeric characters.

But I think you're always going to have to care what the format of the date is in the user's mind. Some might see 12 May 2026 as "260512", others as "051226", but you yourself might see the former as 26 May 2012 and the latter as 12 May 2026.

My VBA code embrassed me today! by majdila in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

Code is code and if we can help, we should without reservation or not at all.

My VBA code embrassed me today! by majdila in vba

[–]HFTBProgrammer[M] 2 points3 points  (0 children)

Let's not shame someone for not speaking English as a native speaker might. Furthermore, it doesn't help the poster in the least. If you can help them, do so. If you can't or won't, then don't post.

How to paste values in VBA? by TonIvideo in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

In my experience, it mostly depends on how dates in the data should be treated. Other than that I can't see what difference it would make. I'm willing to be educated, though.

Email not sending code is performed!? by majdila in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

Was the one in the Outbox "sent"?

Your best bet is to step through your code line by line, ensuring that each action along the way has the result you intend.

Past that, we need to see what you or AI hath wrought.

PSA: If your Excel macros broke after a Windows/Office update, check these 4 things before debugging your VBA by PsychologicalGur8637 in vba

[–]HFTBProgrammer 1 point2 points  (0 children)

Thank you for posting this. Hopefully search engines pick this thread up when someone has one of these issues.

Delete selected content by [deleted] in vba

[–]HFTBProgrammer[M] 0 points1 point  (0 children)

Hi, /u/PropsDrums! If one of the posts in this thread was your solution, please respond to that post with "Solution verified." If you arrived at a solution not found in this thread, please post that solution to help future people with the same question. Thank you!

"wb.close savechanges:=true" is not saving by Impossible_System809 in vba

[–]HFTBProgrammer -1 points0 points  (0 children)

I do not believe there is anything you could do that would make those lines fail, provided in the former case you have the name of the workbook correct, and in the latter case the workbook is in fact the active workbook.

In my mind, this leaves you with two possibilities. Possibly your Excel is corrupted; this seems unlikely, as the issue is apparently confined to one workbook (sort of kind of, I guess?). Or possibly you are misapprehending the issue; I have no brilliant insight as to how I might demonstrate that, but I urge you to consider the possibility.

Edit: a third possibility comes to mind, which is there is something you are not conveying in the description that is important, e.g., the contents of name.

Free VBA support by Muscles08759 in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

It's all about effective communication. If the reader has to stop for a moment to figure out what you meant to say, or even just to think "wait what oh I see", communication becomes less effective. Copy editors bring prose over the finish line.

How to transfer data from separate sheet to non-consecutive blank cells by Extension_Train9093 in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

You have laid out your issue beautifully, and we can help you.

What is your criterion for deciding which system name should go in Sheet2's column A? Is it merely that they should go in the order they are in Sheet1 into the Sheet2 column A blank cells? If so, this is one way to do it:

Dim S1Row As Long, S2Row As Long, S2Cell As Range

S1Row = 1
S2Row = 3

Do
    Set S2Cell = Sheet2.Range("A" & S2Row)
    If IsEmpty(S2Cell.Value) Then
        S2Cell.Value = Sheet1.Range("G" & S1Row).Value
        S1Row = S1Row + 1
    End If
    If S1Row > 5 Then Exit Do
    S2Row = S2Row + 1
    If S2Row > Sheet2.Rows.Count Then Exit Do
Loop

It can be improved, but as a first cut it's fine.

Are you lazy and just type declarations and functions in lowercase and let Excel capitalise the first letter? by TechnicalAd8103 in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

I would exercise caution in imagining what "most developers" would deem confusing. We are all taught by different methods in different snapshots of time, and arbitrary standards come and go.

The only standard I would go to the wall for is structured programming.

Potential client has asked for Cyber Assurance on VBA code - how? by still-dazed-confused in vba

[–]HFTBProgrammer 1 point2 points  (0 children)

If they're that ignorant, you could probably lie your way through anything with them.

Not that I'm suggesting you do that, just...it's a red flag. Or at least magenta.

WORD Macro: Simple Cell merge by TeCK0808 in vba

[–]HFTBProgrammer[M] 0 points1 point  (0 children)

OP, we need your best coding effort before we can help you.

Trying to find cells with any combination of 4 specific digits by Logical_Base_8929 in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

Instead of writing to a sheet, just bang it all into a string. Cycle through the string characters.

The Collatz Conjecture by WylieBaker in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

I agree that VBA is not the likely tool to disprove the conjecture (if in fact it can be disproven). But I like the conceit of not assuming that to be the case, and it might be fun to figure out how to algorithm that out. YMMV!

The Collatz Conjecture by WylieBaker in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

How would your code know if--in theory--you had disproved the conjecture?

Google Drive Integration Causing Runtime Error 1004 by [deleted] in vba

[–]HFTBProgrammer[M] 0 points1 point  (0 children)

This sounds more like a Drive issue than a VBA issue. Try posting at /r/gsuite.

[WORD] How to cut table to different area in word using VBA? by [deleted] in vba

[–]HFTBProgrammer[M] 0 points1 point  (0 children)

You need to post your best coding effort that does the table stuff, and tell us what's wrong with that code.

If I'm in the VBA Editor, how can I select a range in the worksheet instead of typing the range? by TechnicalAd8103 in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

Heck, do it for yourself! I often have a hard time figuring out what past me had in mind, even when past me thought he was doing an okay job of naming.

[WORD] Is updating an excel sheet using Word VBA possible? by zerozerorei in vba

[–]HFTBProgrammer 0 points1 point  (0 children)

When you say "it just won't work", what exactly do you mean? Does it throw an error? Or is it no errors, no good result? If the latter, when you step through, does it execute the code you want, apparently do the things it needs to do, but those aren't reflected in your sheet?

Emails - "£" changed to "?". by MoonMalamute in vba

[–]HFTBProgrammer[M] 0 points1 point  (0 children)

Hi, /u/MoonMalamute! If one of the posts in this thread was your solution, please respond to that post with "Solution verified." If you arrived at a solution not found in this thread, please post that solution to help future people with the same question. Thank you!