Hi. I have this program that opens an input excel file, reads each cell, stores the value into a variable, opens a datebase, searches books based on that variable, extracts them as a data table, creates a new sheet with the variable name in an excel output file, puts the data table there and then goes back to the input excel file, reads the next cell etc. Everything works perfect, however I’d also like to add borders so it looks more professional.
All I know is that: the output file starts from A1, ends at H. However I don’t know which row, but it’s max 41. Each sheet also has headers at the top so basically the headers + max. 40 books can be displayed. I’d prefer using a vba since I find it easier to just copy paste the code instead of creating a workflow. Also please note that some cells inside this unknown range are blank, but I don’t care about that, I want borders for them as well!
This whole process happens inside an excel scope and I tried using the send hotkey thing, but it didn’t work since the processes kinda happen in the background I think? I’m just a beginner at this program so please also tell me what I should change inside the vba code.
Thank you if you help, I really need this in a few hours!
I managed to solve it with this, but it took me 2h to actually find a solution that worked.
Sub macro2()
Dim rng As Range
Set rng = Range(“A1”).CurrentRegion
With rng.Borders
.LineStyle = xlContinuous
.Color = RGB(0, 0, 0)
.Weight = xlThin
End With
End Sub
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.